CLOUDSTACK-9773: Don't break API output with non-printable characters (#1936)

This commit is contained in:
Marc-Aurèle Brothier 2017-08-19 20:55:20 +02:00 committed by Rohit Yadav
parent d450e1acc0
commit 4e4d7c7e36

View File

@ -487,8 +487,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
final Pattern pattern = Pattern.compile(CONTROL_CHARACTERS);
final Matcher matcher = pattern.matcher(value[0]);
if (matcher.find()) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Received value " + value[0] + " for parameter " + key +
" is invalid, contains illegal ASCII non-printable characters");
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Received value containing illegal ASCII non-printable characters for parameter " + key);
}
}
stringMap.put(key, value[0]);