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

lukaszlenart pushed a commit to branch fix/WW-5500
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 575e4e8c9b0be2c1add1597099b7c2b90d93e5fa
Author: Lukasz Lenart <lukaszlen...@apache.org>
AuthorDate: Fri Jan 3 17:10:59 2025 +0100

    WW-5500 Extends pattern to validate multipart uploads
---
 core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java     | 2 +-
 core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java 
b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
index ec5333864..f55108719 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
@@ -112,7 +112,7 @@ public class Dispatcher {
      */
     public static final String REQUEST_POST_METHOD = "POST";
 
-    public static final String MULTIPART_FORM_DATA_REGEX = 
"^multipart/form-data(?:\\s*;\\s*boundary=[0-9a-zA-Z'()+_,\\-./:=?]{1,70})?(?:\\s*;\\s*charset=[a-zA-Z\\-0-9]{3,14})?";
+    public static final String MULTIPART_FORM_DATA_REGEX = 
"^multipart/form-data(?:\\s*;\\s*boundary=[0-9a-zA-Z'\"()+_,\\-./:=?]{1,70})?(?:\\s*;\\s*charset=[a-zA-Z\\-0-9]{3,14})?";
 
     private static final String CONFIG_SPLIT_REGEX = "\\s*,\\s*";
 
diff --git 
a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java 
b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
index 54b2a96f1..6cce6e601 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
@@ -343,6 +343,9 @@ public class DispatcherTest extends 
StrutsJUnit4InternalTestCase {
 
         req.setContentType("Multipart/Form-Data ; 
boundary=---------------------------207103069210263;charset=UTF-16LE");
         assertTrue(dispatcher.isMultipartRequest(req));
+
+        req.setContentType("multipart/form-data; 
boundary=\"----=_Part_38_1092302434.1734807780737\"");
+        assertTrue(dispatcher.isMultipartRequest(req));
     }
 
     @Test

Reply via email to