Repository navigation
Conversation
FormEncoder looked for the charset with a case-sensitive pattern that did not accept a quoted value, so Content-Type headers such as 'Charset=ISO-8859-1' or 'charset="ISO-8859-1"' fell back to UTF-8 and the header was rewritten to charset=UTF-8. Parameter names are case-insensitive and values may be quoted (RFC 9110 8.3.1), and Response.charset() already reads both forms. Signed-off-by: kdelay <kdelay20@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FormEncoderreads the charset with(?<=charset=)([\w\-]+), which is case-sensitive and stops at a quote. WithContent-Type: application/x-www-form-urlencoded; Charset=ISO-8859-1Content-Type: application/x-www-form-urlencoded; charset="ISO-8859-1"the body is encoded as UTF-8 (
name=%C3%A9instead ofname=%E9) and the header is rewritten tocharset=UTF-8. Both forms are valid per RFC 9110 8.3.1, andResponse.charset()already reads them.The pattern now ignores case and accepts an optional opening quote.
Two tests in
FormEncoderCharsetTestfail without the change.mvn -pl form,form-spring installpasses.