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 Prokharchyk 2011-11-07 18:00:11 -08:00
parent 1660ae3890
commit 657edb1a56
1 changed files with 2 additions and 2 deletions

View File

@ -531,14 +531,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");
}
}