Bug 49964

Summary: Allow parsing of application/x-www-form-urlencoded request body into getParameter methods for PUT requests
Product: Tomcat 6 Reporter: Christopher Schultz <chris>
Component: ConnectorsAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement    
Priority: P2    
Version: unspecified   
Target Milestone: default   
Hardware: PC   
OS: All   

Description Christopher Schultz 2010-09-20 13:50:55 UTC
(Apologies for the awkward summary, but I wanted this bug to be easily findable in bugzilla)

A couple of questions have been raised on various lists about why Tomcat doesn't support auto-parsing of PUT requests, and the reason is clear: the servlet spec doesn't require it. On the other hand, it seems that there are enough users who would love to have this capability, and it doesn't seem to be too difficult to implement, so why not go ahead and do it?

My proposal is this (and I'm prepared to write the patches myself):

1. A new configuration attribute on the <Connector> element: "parseBodyRequestParametersMethods" (suggestions for a better name are welcome). The default value for this setting is "POST" which retains strict servlet spec compliance.

2. Change catalina.connector.Request.parseParameters method to allow any method mentioned in the above configuration attribute to undergo request body conversion into request parameters. All other existing requirements remain in place: the request body must be application/x-www-form-urlencoded, must fit into maxPostSize, etc.

One question I have about this implementation: how should it behave under org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true? I believe that org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true should take precedence over this setting, disable it's use, and issue a warning/error during startup when they conflict.
Comment 1 Christopher Schultz 2010-09-20 13:52:39 UTC
References to some list discussions that are relevant:

http://markmail.org/message/dxgvu6fhcvp22xbo [tomcat-user]
http://markmail.org/message/opptokzqz7y6z7nk [cocoon-user]
Comment 2 Mark Thomas 2010-09-20 16:31:54 UTC

*** This bug has been marked as a duplicate of bug 48692 ***