Fix context returned in JSON error (had null bytes).
Update status test cases to match new API.
This commit is contained in:
committed by
Patrick Niklaus
parent
89d56e1cd1
commit
2cf19010e3
@@ -99,9 +99,12 @@ void RequestHandler::HandleRequest(const http::request ¤t_request, http::r
|
||||
else
|
||||
{
|
||||
const auto position = std::distance(request_string.begin(), api_iterator);
|
||||
const auto context_begin = request_string.begin() + std::max(position - 3UL, 0UL);
|
||||
BOOST_ASSERT(position >= 0);
|
||||
const auto context_begin = request_string.begin() + ((position < 3) ? 0 : (position - 3UL));
|
||||
BOOST_ASSERT(context_begin >= request_string.begin());
|
||||
const auto context_end =
|
||||
request_string.begin() + std::min(position + 3UL, request_string.size());
|
||||
BOOST_ASSERT(context_end <= request_string.end());
|
||||
std::string context(context_begin, context_end);
|
||||
|
||||
current_reply.status = http::reply::bad_request;
|
||||
|
||||
Reference in New Issue
Block a user