mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Improve error handling when user specifies invalid method for /v1/console
refs #10387
This commit is contained in:
parent
315232bbcc
commit
3a695742e3
@ -93,12 +93,12 @@ bool ConsoleHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& reques
|
|||||||
|
|
||||||
bool sandboxed = HttpUtility::GetLastParameter(params, "sandboxed");
|
bool sandboxed = HttpUtility::GetLastParameter(params, "sandboxed");
|
||||||
|
|
||||||
if (methodName == "execute-script") {
|
if (methodName == "execute-script")
|
||||||
return ExecuteScriptHelper(request, response, command, session, sandboxed);
|
return ExecuteScriptHelper(request, response, command, session, sandboxed);
|
||||||
} else if (methodName == "auto-complete-script") {
|
else if (methodName == "auto-complete-script")
|
||||||
return AutocompleteScriptHelper(request, response, command, session, sandboxed);
|
return AutocompleteScriptHelper(request, response, command, session, sandboxed);
|
||||||
}
|
|
||||||
|
|
||||||
|
HttpUtility::SendJsonError(response, 400, "Invalid method specified: " + methodName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user