Author: markt
Date: Fri Aug 31 12:20:59 2018
New Revision: 1839752

URL: http://svn.apache.org/viewvc?rev=1839752&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=62664
Process requests with content type multipart/form-data to servlets with a 
@MultipartConfig annotation regardless of HTTP method.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/config/ajp.xml
    tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1839752&r1=1839751&r2=1839752&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Aug 31 
12:20:59 2018
@@ -3170,11 +3170,6 @@ public class Request implements HttpServ
                 return;
             }
 
-            if( !getConnector().isParseBodyMethod(getMethod()) ) {
-                success = true;
-                return;
-            }
-
             String contentType = getContentType();
             if (contentType == null) {
                 contentType = "";
@@ -3191,6 +3186,11 @@ public class Request implements HttpServ
                 success = true;
                 return;
             }
+
+            if( !getConnector().isParseBodyMethod(getMethod()) ) {
+                success = true;
+                return;
+            }
 
             if (!("application/x-www-form-urlencoded".equals(contentType))) {
                 success = true;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1839752&r1=1839751&r2=1839752&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Aug 31 12:20:59 2018
@@ -51,6 +51,12 @@
         Improve the handling of path parameters when working with
         RequestDispatcher objects. (markt)
       </fix>
+      <fix>
+        <bug>62664</bug>: Process requests with content type
+        <code>multipart/form-data</code> to servlets with a
+        <code>@MultipartConfig</code> annotation regardless of HTTP method.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">

Modified: tomcat/trunk/webapps/docs/config/ajp.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=1839752&r1=1839751&r2=1839752&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/ajp.xml (original)
+++ tomcat/trunk/webapps/docs/config/ajp.xml Fri Aug 31 12:20:59 2018
@@ -148,9 +148,9 @@
 
     <attribute name="parseBodyMethods" required="false">
       <p>A comma-separated list of HTTP methods for which request
-      bodies will be parsed for request parameters identically
-      to POST. This is useful in RESTful applications that want to
-      support POST-style semantics for PUT requests.
+      bodies using <code>application/x-www-form-urlencoded</code>will be parsed
+      for request parameters identically to POST. This is useful in RESTful
+      applications that want to support POST-style semantics for PUT requests.
       Note that any setting other than <code>POST</code> causes Tomcat
       to behave in a way that goes against the intent of the servlet
       specification.

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1839752&r1=1839751&r2=1839752&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Fri Aug 31 12:20:59 2018
@@ -145,9 +145,9 @@
 
     <attribute name="parseBodyMethods" required="false">
       <p>A comma-separated list of HTTP methods for which request
-      bodies will be parsed for request parameters identically
-      to POST. This is useful in RESTful applications that want to
-      support POST-style semantics for PUT requests.
+      bodies using <code>application/x-www-form-urlencoded</code>will be parsed
+      for request parameters identically to POST. This is useful in RESTful
+      applications that want to support POST-style semantics for PUT requests.
       Note that any setting other than <code>POST</code> causes Tomcat
       to behave in a way that goes against the intent of the servlet
       specification.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to