Author: jacopoc
Date: Fri Dec 5 08:18:20 2014
New Revision: 1643184
URL: http://svn.apache.org/viewvc?rev=1643184&view=rev
Log:
Added code to ignore the optional charset as the key to retrieve the
requestBodyMapHandler. For example the same handler will be found and used when
the Content-Type header is set as:
application/json
application/json;charset=utf-8
application/json;charset=UTF-8
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RequestBodyMapHandlerFactory.java
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RequestBodyMapHandlerFactory.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RequestBodyMapHandlerFactory.java?rev=1643184&r1=1643183&r2=1643184&view=diff
==============================================================================
---
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RequestBodyMapHandlerFactory.java
(original)
+++
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RequestBodyMapHandlerFactory.java
Fri Dec 5 08:18:20 2014
@@ -31,7 +31,11 @@ public class RequestBodyMapHandlerFactor
}
public static RequestBodyMapHandler
getRequestBodyMapHandler(ServletRequest request) {
- return requestBodyMapHandlers.get(request.getContentType());
+ String contentType = request.getContentType();
+ if (contentType != null && contentType.indexOf(";") != -1) {
+ contentType = contentType.substring(0, contentType.indexOf(";"));
+ }
+ return requestBodyMapHandlers.get(contentType);
}
public static Map<String, Object> extractMapFromRequestBody(ServletRequest
request) throws IOException {