-
Bug
-
Resolution: Done
-
Major
-
1.1.GA
-
None
-
None
HTTP Internal Server Error when Content-Type header is a space for HTTP PUT method.
To reproduce.
1. Implement a PUT REST resource i.e. from you example: https://resteasy.svn.sourceforge.net/svnroot/resteasy/tags/RESTEASY_JAXRS_1_1_GA/examples/simple/src/main/java/com/restfully/shop/services/CustomerResource.java,
- updateCustomer
2. Start up a server with this resource
3. Send a HTTP POST request with all data to create a customer
4. Send a HTTP PUT request with all data to update except for the header "Content-Type". Set this header to be a single space (" ")
Result:
HTTP 500 Internal Server error
java.lang.IllegalArgumentException: Failure parsing MediaType string:
at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.parse(MediaTypeHeaderDelegate.java:116)
at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.fromString(MediaTypeHeaderDelegate.java:16)
at javax.ws.rs.core.MediaType.valueOf(MediaType.java:191)
at org.jboss.resteasy.plugins.server.servlet.ServletUtil.extractHttpHeaders(ServletUtil.java:89)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:84)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:70)
Remarks:
It should be 400 Bad request response. I am not sure if the same bug occurs for a POST method.