Ensure that multiple object handler request methods still work

refs #10194
This commit is contained in:
Michael Friedrich 2015-09-27 15:27:08 +02:00
parent 717118fed4
commit 6549721ec6
3 changed files with 7 additions and 5 deletions

View File

@ -32,8 +32,8 @@ REGISTER_URLHANDLER("/v1", CreateObjectHandler);
bool CreateObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& request, HttpResponse& response)
{
if (request.RequestMethod != "PUT") {
HttpUtility::SendJsonError(response, 400, "Invalid request type. Must be PUT.");
return true;
/* there might be other request methods pending */
return false;
}
if (request.RequestUrl->GetPath().size() < 3) {

View File

@ -35,8 +35,8 @@ REGISTER_URLHANDLER("/v1", DeleteObjectHandler);
bool DeleteObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& request, HttpResponse& response)
{
if (request.RequestMethod != "DELETE") {
HttpUtility::SendJsonError(response, 400, "Invalid request type. Must be DELETE.");
return true;
/* there might be other request methods pending */
return false;
}
if (request.RequestUrl->GetPath().size() < 2) {

View File

@ -32,8 +32,10 @@ REGISTER_URLHANDLER("/v1", ModifyObjectHandler);
bool ModifyObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& request, HttpResponse& response)
{
if (request.RequestMethod != "POST")
if (request.RequestMethod != "POST") {
/* there might be other request methods pending */
return false;
}
if (request.RequestUrl->GetPath().size() < 2)
return false;