Repository navigation
Query and form parameters whose value contains = are truncated or rejected as malformed - #1074
Open
chuuminggg wants to merge 2 commits into
Open
chuuminggg wants to merge 2 commits into
chuuminggg wants to merge 2 commits into
Conversation
Member
|
Thanks, @chuuminggg. 3.0.x is no longer supported. Can you please update your PR to use 4.0.x as its base branch? |
chuuminggg
force-pushed
the
n2-parameter-value-containing-equals
branch
from
October 15, 2026 23:22
2b7fbb3 to
5c753cf
Compare
Previously, QueryParameters, FormParameters, and MockMvcRequestConverter split a parameter on every = so a value containing = was either truncated or rejected as malformed. Parameters are now only split on their first =. The name of a parameter with no value is also now decoded. Fixes spring-projectsgh-1073 Signed-off-by: chuuminggg <rorrxr@naver.com>
chuuminggg
force-pushed
the
n2-parameter-value-containing-equals
branch
from
October 16, 2026 00:46
5c753cf to
189a20b
Compare
Contributor
Author
|
I've rebased the PR onto 4.0.x and changed its base branch. The tests have also been updated to use JUnit 5 to match the 4.0.x conventions. |
Signed-off-by: chuuminggg <rorrxr@naver.com>
This branch has not been deployed
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.
Fixes gh-1073
This updates
QueryParameters,FormParameters, andMockMvcRequestConverterto only split a parameter on its first=, in the same way as was done for cookies in #1040. Previously, a value containing=was either truncated (cursor=YWJj==becameYWJj) or rejected as malformed (filter=name==bob). With MockMvc, the latter caused aConversionExceptionwhen the request was built from aURI, and the former caused the query parameter to be duplicated in the form URL encoded request body.The name of a parameter with no value is now also decoded, which makes it consistent with a parameter that has a value. As every input can now be parsed, the
IllegalArgumentExceptionfor a malformed parameter is no longer thrown.There were no tests for
QueryParametersandFormParameters, so I've added them, covering the existing behavior as well as the new cases.