From 4e4d7c7e36252142d2d997954e87ffba37b34c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20Brothier?= Date: Sat, 19 Aug 2017 20:55:20 +0200 Subject: [PATCH] CLOUDSTACK-9773: Don't break API output with non-printable characters (#1936) --- server/src/com/cloud/api/ApiServer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java index 40c95a06ea7..9e237741c96 100644 --- a/server/src/com/cloud/api/ApiServer.java +++ b/server/src/com/cloud/api/ApiServer.java @@ -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]);