Skip to content
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

URLSearchParams: \n not encoded correctly #7888

Closed
5chulzi opened this issue Oct 8, 2020 · 2 comments · Fixed by #7905
Closed

URLSearchParams: \n not encoded correctly #7888

5chulzi opened this issue Oct 8, 2020 · 2 comments · Fixed by #7905
Labels
bug Something isn't working correctly ext/web related to the ext/web crate good first issue Good for newcomers

Comments

@5chulzi
Copy link

5chulzi commented Oct 8, 2020

When encoding newline characters with URLSearchParams they result in value %A instead of %0A.

// Deno 1.4.5
console.log(new URLSearchParams({ test: "\n" }).toString()) // "test=%A"
// Browser as well as Node.js v14.10.0
console.log(new URLSearchParams({ test: "\n" }).toString()) // "test=%0A"

I'm not sure if I'm missing something in the docs or elsewhere, but that's what I noticed while using URLSearchParams in Deno.

@ry ry added bug Something isn't working correctly good first issue Good for newcomers labels Oct 8, 2020
@kitsonk kitsonk added the ext/web related to the ext/web crate label Oct 9, 2020
@lala7573
Copy link
Contributor

lala7573 commented Oct 9, 2020

Hello, can I try this?

@lucacasonato
Copy link
Member

lucacasonato commented Oct 9, 2020

@lala7573 Sure! You can find the implementation for URLSearchParams here: https://github.com/denoland/deno/blob/master/op_crates/web/11_url.js#L45. Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ext/web related to the ext/web crate good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants