Always process responses inside RootResource
The REST API would skip propagation of the requests to the RootResource if it was a request to the empty resource.
This commit is contained in:
@ -121,12 +121,7 @@ int Client::process(string url, string method, const char* upload_data, size_t*
|
|||||||
|
|
||||||
MXS_DEBUG("Request:\n%s", request.to_string().c_str());
|
MXS_DEBUG("Request:\n%s", request.to_string().c_str());
|
||||||
|
|
||||||
if (url == "/")
|
if (request.validate_api_version())
|
||||||
{
|
|
||||||
// Respond to pings with 200 OK
|
|
||||||
reply = HttpResponse(MHD_HTTP_OK);
|
|
||||||
}
|
|
||||||
else if (request.validate_api_version())
|
|
||||||
{
|
{
|
||||||
reply = resource_handle_request(request);
|
reply = resource_handle_request(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,8 +86,11 @@ bool HttpRequest::validate_api_version()
|
|||||||
{
|
{
|
||||||
bool rval = false;
|
bool rval = false;
|
||||||
|
|
||||||
if (m_resource_parts.size() > 0
|
if (m_resource_parts.empty())
|
||||||
&& m_resource_parts[0] == MXS_REST_API_VERSION)
|
{
|
||||||
|
rval = true;
|
||||||
|
}
|
||||||
|
else if (m_resource_parts[0] == MXS_REST_API_VERSION)
|
||||||
{
|
{
|
||||||
m_resource_parts.pop_front();
|
m_resource_parts.pop_front();
|
||||||
rval = true;
|
rval = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user