This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3f8a229be8cbdd99e718b1b72b5f9c0ea1421c23
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Aug 15 19:54:02 2023 +0100

    With the changes to parameter error handling all parsing is explicit
---
 java/org/apache/catalina/connector/Request.java | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index a12fdb4226..9a6de071d5 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2638,7 +2638,7 @@ public class Request implements HttpServletRequest {
     @Override
     public Collection<Part> getParts() throws IOException, 
IllegalStateException, ServletException {
 
-        parseParts(true);
+        parseParts();
 
         if (partsParseException != null) {
             if (partsParseException instanceof IOException) {
@@ -2653,7 +2653,7 @@ public class Request implements HttpServletRequest {
         return parts;
     }
 
-    private void parseParts(boolean explicit) {
+    private void parseParts() {
 
         // Return immediately if the parts have already been parsed
         if (parts != null || partsParseException != null) {
@@ -2668,13 +2668,8 @@ public class Request implements HttpServletRequest {
                 mce = new MultipartConfigElement(null, 
connector.getMaxPostSize(), connector.getMaxPostSize(),
                         connector.getMaxPostSize());
             } else {
-                if (explicit) {
-                    partsParseException = new 
IllegalStateException(sm.getString("coyoteRequest.noMultipartConfig"));
-                    return;
-                } else {
-                    parts = Collections.emptyList();
-                    return;
-                }
+                partsParseException = new 
IllegalStateException(sm.getString("coyoteRequest.noMultipartConfig"));
+                return;
             }
         }
 
@@ -3061,7 +3056,7 @@ public class Request implements HttpServletRequest {
             }
 
             if ("multipart/form-data".equals(contentType)) {
-                parseParts(false);
+                parseParts();
                 success = true;
                 return;
             }


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

Reply via email to