Skip to content

querystring: fix overlapping pair separators - #67983

Open
seungwoo505 wants to merge 1 commit into
nodejs:mainfrom
seungwoo505:fix-querystring-multichar-separator
Open

seungwoo505 wants to merge 1 commit into
nodejs:mainfrom
seungwoo505:fix-querystring-multichar-separator

Conversation

@seungwoo505

@seungwoo505 seungwoo505 commented Dec 3, 2026 •

Copy link
Copy Markdown

Summary

querystring.parse('a=--_b=2', '-_') returns { a: '--_b=2' }. The expected result is { a: '-', b: '2' }. After a partial match fails, the parser skips the character that starts the complete separator.

Use StringPrototypeIndexOf() to find the next complete separator. Add regression tests for overlapping prefixes, maxKeys, decoding, and separator precedence.

Testing

  • On Ubuntu WSL, 129 querystring, URL, and WPT tests passed, with 12 WPT cases skipped.
  • Across 12 benchmark runs per build, multicharsep throughput improved by 11.6%. noencode showed no statistically significant change.
  • ESLint passed for both changed files.

Match complete pair separators so a failed prefix match cannot hide a
separator that starts inside that prefix.

Cover overlaps, maxKeys, decoding, and separator precedence.

Signed-off-by: seungwoo <zoozoo1302@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. querystring Issues and PRs related to the built-in querystring module. labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

@seungwoo505
seungwoo505 marked this pull request as ready for review December 3, 2026 04:34
@seungwoo505
seungwoo505 marked this pull request as draft December 3, 2026 06:47
@seungwoo505
seungwoo505 marked this pull request as ready for review December 3, 2026 06:57
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. querystring Issues and PRs related to the built-in querystring module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants