Skip to content

UriModifyingContentModifier.modifyContent decodes with the request charset but re-encodes with the platform default#1043

Merged
wilkinsona merged 1 commit intospring-projects:3.0.xfrom
config25:fix/uri-modifier-charset-encoding
May 7, 2026
Merged

UriModifyingContentModifier.modifyContent decodes with the request charset but re-encodes with the platform default#1043
wilkinsona merged 1 commit intospring-projects:3.0.xfrom
config25:fix/uri-modifier-charset-encoding

Conversation

@config25
Copy link
Copy Markdown
Contributor

@config25 config25 commented May 7, 2026

UriModifyingContentModifier.modifyContent() decodes the request/response
body using the charset from the Content-Type header, but re-encodes with
String.getBytes() (no charset argument), which falls back to the JVM
default. When these differ, non-ASCII characters get corrupted.

Use the same charset for both decoding and encoding, falling back to
Charset.defaultCharset() when no charset is declared.

Fixes gh-1039
Supersedes #1041 (which became un-reopenable after force-push during merge processing).

See spring-projectsgh-1043

Signed-off-by: config25 <yhkim052556@naver.com>
@wilkinsona wilkinsona force-pushed the fix/uri-modifier-charset-encoding branch from e7f0e1c to 0a449a9 Compare May 7, 2026 07:34
@wilkinsona wilkinsona merged commit 7bf83d2 into spring-projects:3.0.x May 7, 2026
4 checks passed
@wilkinsona wilkinsona modified the milestones: 3.0.x, 3.0.6 May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants