-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Use UTF-8 by default for JSON multipart content in ContentRequestMatchers
#31924
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
Use UTF-8 by default for JSON multipart content in ContentRequestMatchers
#31924
Conversation
@azdanov Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@azdanov Thank you for signing the Contributor License Agreement! |
ContentRequestMatchers
for multipart data handling
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.
Let me know if you agree with the proposed change below and whether you'd like to do it?
fileUpload.setFileItemFactory(new DiskFileItemFactory()); | ||
DiskFileItemFactory factory = new DiskFileItemFactory(); | ||
factory.setDefaultCharset(DEFAULT_ENCODING); | ||
fileUpload.setFileItemFactory(factory); |
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.
Switching the general default could break existing tests, and that should wait for a major or minor release. In the meantime, we could narrow the scope and default to UTF-8 specifically for JSON. That would be safer and addresses the original issue.
I agree, but I don't have time now. So feel free to add. |
ContentRequestMatchers
for multipart data handlingContentRequestMatchers
Moving to 6.2 to avoid any regressions in a maintenance release. |
This should resolve #31923
I've added default UTF-8 charset to be used in
DiskFileItemFactory
.This should allow ContentRequestMatchers to correctly handle multipartData which contains unicode.