6ad55ef2 by Ean Schuessler

Make detection of form-encoded forgiving #4034

1 parent a9fc2c01
......@@ -130,8 +130,10 @@ public class DirectControlServlet extends HttpServlet {
}
} else {
// Check if the request is a backbone style "emulateJSON" request
if (request.getContentType() == "application/x-www-form-urlencoded" &&
Debug.logInfo("MODEL: " + request.getParameter("model"), module);
if (request.getContentType().indexOf("x-www-form-urlencoded") > 0 &&
request.getParameter("model") != null) {
Debug.logInfo("MODEL: " + request.getParameter("model"), module);
JSON json = new JSON(new StringReader(request.getParameter("model")));
Map<String,Object> items = json.JSONObject();
for (String key : items.keySet()) {
......