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:
parent
7d54df74dc
commit
d65269fabb
@ -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());
|
||||
|
||||
if (url == "/")
|
||||
{
|
||||
// Respond to pings with 200 OK
|
||||
reply = HttpResponse(MHD_HTTP_OK);
|
||||
}
|
||||
else if (request.validate_api_version())
|
||||
if (request.validate_api_version())
|
||||
{
|
||||
reply = resource_handle_request(request);
|
||||
}
|
||||
|
@ -86,8 +86,11 @@ bool HttpRequest::validate_api_version()
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
if (m_resource_parts.size() > 0
|
||||
&& m_resource_parts[0] == MXS_REST_API_VERSION)
|
||||
if (m_resource_parts.empty())
|
||||
{
|
||||
rval = true;
|
||||
}
|
||||
else if (m_resource_parts[0] == MXS_REST_API_VERSION)
|
||||
{
|
||||
m_resource_parts.pop_front();
|
||||
rval = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user