From a013640180273355f26647191573019ff5d43295 Mon Sep 17 00:00:00 2001 From: "Ragnar B. Johannsson" Date: Thu, 6 Jan 2011 14:25:59 +0000 Subject: [PATCH] Bugfix: Do not URL-decode API parameters twice. There's no need to call ApiServer's handleRequest with decode=true since Tomcat has already url-decoded the parameters. URL-decoding twice breaks all Base64 encoded data such as userData in deployVM, since %2b decodes to ' ', not '+' as it should. --- server/src/com/cloud/api/ApiServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiServlet.java b/server/src/com/cloud/api/ApiServlet.java index b8f19b78d2e..b2948e71527 100755 --- a/server/src/com/cloud/api/ApiServlet.java +++ b/server/src/com/cloud/api/ApiServlet.java @@ -263,7 +263,7 @@ public class ApiServlet extends HttpServlet { auditTrailSb.insert(0, "(userId="+UserContext.current().getCallerUserId()+ " accountId="+UserContext.current().getCaller().getId()+ " sessionId="+(session != null ? session.getId() : null)+ ")" ); try { - String response = _apiServer.handleRequest(params, true, responseType, auditTrailSb); + String response = _apiServer.handleRequest(params, false, responseType, auditTrailSb); writeResponse(resp, response != null ? response : "", HttpServletResponse.SC_OK, responseType); } catch (ServerApiException se) { String serializedResponseText = _apiServer.getSerializedApiError(se.getErrorCode(), se.getDescription(), params, responseType);