-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WW-4818 change default Multipart validation regex to comply with RFC1341 #151
Conversation
@@ -88,7 +88,7 @@ | |||
*/ | |||
public static final String REQUEST_POST_METHOD = "POST"; | |||
|
|||
public static final String MULTIPART_FORM_DATA_REGEX = "^multipart\\/form-data(; boundary=[\\-a-zA-Z0-9]{1,70})?"; | |||
public static final String MULTIPART_FORM_DATA_REGEX = "^multipart/form-data(; boundary=[0-9a-zA-Z'()+_,\\-./:=?]{1,70})?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to escape .
as it now means Any single character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also -
has to be escaped as it is treated as a group separator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not within the square brackets according to my knowledge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o! didn't know that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct about the -
needing to be escaped , but that's the only one i escaped. (they're in the order they're mentioned in RFC1341 (so i moved the -
backwards in the pattern)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two test cases that you can extend or another one - see DispatcherTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i'll add some tests to confirm the pattern is correct.
(Or if needed to correct it)
@lukaszlenart
Please feel free to tell me what other test-cases you want added. |
Looks good 👍 LGTM :) |
@lukaszlenart |
No description provided.