MXS-1220: Respond with 200 OK to root level requests
If a request to the `/` resource is made, the API responds with an 200 OK. This is done to make it possible to use the HTTP health check mechanism found in many cloud load balancers.
This commit is contained in:
@ -104,7 +104,12 @@ int Client::process(string url, string method, const char* upload_data, size_t *
|
||||
HttpRequest request(m_connection, url, method, json);
|
||||
HttpResponse reply(MHD_HTTP_NOT_FOUND);
|
||||
|
||||
if (request.validate_api_version())
|
||||
if (url == "/")
|
||||
{
|
||||
// Respond to pings with 200 OK
|
||||
reply = HttpResponse(MHD_HTTP_OK);
|
||||
}
|
||||
else if (request.validate_api_version())
|
||||
{
|
||||
reply = resource_handle_request(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user