-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different query parsing behavior between node and browsers for URLSearchParams
#33892
Labels
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
Comments
@annevk ... would like your input on this issue if you're able. Just need to confirm what the correct behavior should be here. |
I think @ijjk is correct. It would be nice to add those tests to WPT |
3 tasks
JFYI: I'm thinking to fix this issue by the below two steps:
|
watilde
added
the
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
label
Sep 2, 2020
Trott
pushed a commit
to watilde/node
that referenced
this issue
Sep 4, 2020
Related: nodejs#33892 Fixes: nodejs#35012 PR-URL: nodejs#35013 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
watilde
added a commit
to watilde/node
that referenced
this issue
Sep 4, 2020
Closing as resolved by #33770 |
joesepi
pushed a commit
to joesepi/node
that referenced
this issue
Jan 8, 2021
Related: nodejs#33892 Fixes: nodejs#35012 PR-URL: nodejs#35013 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What steps will reproduce the bug?
Attempt to parse query strings with either
querystring.parse
orURLSearchParams
with a%
and then a properly percent-encoded value.or just
How often does it reproduce? Is there a required condition?
Whenever a query string with a
%
and then a properly percent-encoded value is attempted to be parsed usingquerystring.parse
orURLSearchParams
What is the expected behavior?
The expected behavior from the spec https://url.spec.whatwg.org/#percent-encoded-bytes stating, if byte is 0x25 (%) and the next two bytes after byte in input are not in the ranges 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), and 0x61 (a) to 0x66 (f), all inclusive, append byte to output.
When testing in latest Safari, Firefox, and Chrome it appears to follow that above spec and they return the expected values in the above snippets from the reproducing section.
What do you see instead?
Additional information
Investigation started while trying to match querystring parsing between the browser and node in this Next.js PR vercel/next.js#12154
It may be the opposite and the browser is not actually following the spec and node is and I'm mis-understanding and if this is the case I can open this issue elsewhere.
The text was updated successfully, but these errors were encountered: