bug 11923: don't expose command name in the exception response when command is not available

status 11923: resolved fixed
reviewed-by: Will Chan
This commit is contained in:
Alena 2011-11-07 17:56:56 -08:00 committed by Alena Prokharchyk
parent 9489d6ffeb
commit 0785b64306
1 changed files with 2 additions and 2 deletions

View File

@ -544,14 +544,14 @@ public class ApiServer implements HttpRequestHandler {
if (!isCommandAvailable(accountType, commandName)) {
s_logger.warn("The given command:" + commandName + " does not exist");
throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + " does not exist");
throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given command does not exist");
}
return true;
} else {
// check against every available command to see if the command exists or not
if (!isCommandAvailable(commandName) && !commandName.equals("login") && !commandName.equals("logout")) {
s_logger.warn("The given command:" + commandName + " does not exist");
throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given command:" + commandName + " does not exist");
throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given command does not exist");
}
}