Skip to content

Commit

Permalink
Merge pull request #1171 from apache/fix/WW-5500-s7
Browse files Browse the repository at this point in the history
WW-5500 Extends pattern to validate multipart uploads
  • Loading branch information
lukaszlenart authored Jan 5, 2025
2 parents fd24a4a + 6d71674 commit 98df24a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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*";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ public void testIsMultipartRequest() {

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
Expand Down

0 comments on commit 98df24a

Please sign in to comment.