Skip to content

util: make MIMEParams accessors case-insensitive#64123

Open
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix/mime-params-case-insensitive
Open

util: make MIMEParams accessors case-insensitive#64123
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix/mime-params-case-insensitive

Conversation

@watilde

@watilde watilde commented Jun 25, 2026

Copy link
Copy Markdown
Member

MIME parameter names are case-insensitive and the parser already ASCII-lowercases them, but MIMEParams.get(), has(), delete() and set() compared against the raw argument. As a result a parsed parameter was unreachable by the casing the caller used (e.g. params.get('Charset') returned null for "Charset=utf-8"), and set() could create duplicate, case-colliding parameters.

Lowercase the name in the accessors to match the parser, consistent with the whatwg-mimetype reference implementation.

MIME parameter names are case-insensitive and the parser already
ASCII-lowercases them, but MIMEParams.get(), has(), delete() and set()
compared against the raw argument. As a result a parsed parameter was
unreachable by the casing the caller used (e.g. params.get('Charset')
returned null for "Charset=utf-8"), and set() could create duplicate,
case-colliding parameters.

Lowercase the name in the accessors to match the parser, consistent with
the whatwg-mimetype reference implementation.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 25, 2026
@watilde watilde added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 27, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 27, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@watilde watilde added the review wanted PRs that need reviews. label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. review wanted PRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants