Improve error handling when user specifies invalid method for /v1/console

refs #10387
This commit is contained in:
Gunnar Beutner 2015-11-07 09:11:16 +01:00
parent 315232bbcc
commit 3a695742e3
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}