mirror of https://github.com/Icinga/icinga2.git
Ensure that multiple object handler request methods still work
refs #10194
This commit is contained in:
parent
717118fed4
commit
6549721ec6
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue