Skip to content

util: make MIMEParams accessors case-insensitive#64123

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
watilde:fix/mime-params-case-insensitive
Jul 12, 2026
Merged

util: make MIMEParams accessors case-insensitive#64123
nodejs-github-bot merged 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
@watilde watilde added commit-queue Add this label to land a pull request using GitHub Actions. and removed review wanted PRs that need reviews. labels Jul 6, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 12, 2026
@nodejs-github-bot
nodejs-github-bot merged commit b4c7be3 into nodejs:main Jul 12, 2026
77 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in b4c7be3

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants