8c10669a by Ean Schuessler

Make detection of form-encoded forgiving #4034

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