Skip to content

Match ContentType parameter names ignoring case - #749

Merged
ok2c merged 1 commit into
apache:masterfrom
sharanggupta:content-type-parameter-names-ignore-case
Nov 18, 2026
Merged

ok2c merged 1 commit into
apache:masterfrom
sharanggupta:content-type-parameter-names-ignore-case

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

ContentType.withParameters compares parameter names case-sensitively, unlike getParameter and create. For ContentType.parse("text/plain; Charset=UTF-8"), withParameters(p=blah) gives text/plain; charset=UTF-8; Charset=UTF-8; p=blah, and withParameters(charset=US-ASCII) leaves the charset at UTF-8. Names are now matched without regard to case; TestContentType#testWithParamsNameCaseInsensitive fails without the change.

withParameters() compared parameter names case-sensitively, unlike the
rest of the class. For "text/plain; Charset=UTF-8" it added a second
charset parameter, and a new "charset" value did not replace the
existing one.
@ok2c
ok2c merged commit 4a0011f into apache:master Nov 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants