8c10669a by Ean Schuessler

Make detection of form-encoded forgiving #4034

1 parent a9fc2c01
...@@ -117,7 +117,6 @@ public class DirectControlServlet extends HttpServlet { ...@@ -117,7 +117,6 @@ public class DirectControlServlet extends HttpServlet {
117 String httpMethod = request.getMethod(); 117 String httpMethod = request.getMethod();
118 if (method == null && httpMethod != null) method = httpMethod; 118 if (method == null && httpMethod != null) method = httpMethod;
119 if (method == null) method = "GET"; 119 if (method == null) method = "GET";
120 Debug.logInfo("Method: HTTP(" + httpMethod + ") embedded(" + method + ")", module);
121 120
122 // Load context 121 // Load context
123 Map<String, Object> context = new HashMap<String, Object>(); 122 Map<String, Object> context = new HashMap<String, Object>();
...@@ -130,7 +129,7 @@ public class DirectControlServlet extends HttpServlet { ...@@ -130,7 +129,7 @@ public class DirectControlServlet extends HttpServlet {
130 } 129 }
131 } else { 130 } else {
132 // Check if the request is a backbone style "emulateJSON" request 131 // Check if the request is a backbone style "emulateJSON" request
133 if (request.getContentType() == "application/x-www-form-urlencoded" && 132 if (request.getContentType().indexOf("x-www-form-urlencoded") != -1 &&
134 request.getParameter("model") != null) { 133 request.getParameter("model") != null) {
135 JSON json = new JSON(new StringReader(request.getParameter("model"))); 134 JSON json = new JSON(new StringReader(request.getParameter("model")));
136 Map<String,Object> items = json.JSONObject(); 135 Map<String,Object> items = json.JSONObject();
......