mirror of https://github.com/Icinga/icinga2.git
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");
|
||||
|
||||
if (methodName == "execute-script") {
|
||||
if (methodName == "execute-script")
|
||||
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);
|
||||
}
|
||||
|
||||
HttpUtility::SendJsonError(response, 400, "Invalid method specified: " + methodName);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue