-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Labels
needs concrete proposalMoving the issue forward requires someone to figure out a detailed planMoving the issue forward requires someone to figure out a detailed planneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: api
Description
See: nodejs/node#33037
Relates to: #18
Because of the differences in URLSearchParams and .search stringification, encoding of the tilde (~) character becomes inconsistent when using URLSearchParam to mutate a URL instance... take the following examples for instance:
const url = new URL('http://httpbin.org/anything?a=~');
url.search = url.searchParams.toString();
// becomes http://httpbin.org/anything?a=%7EAnd...
(demonstrated in Node.js, but appears consistent across implementations)
C:\Users\jasne\Projects\tmp>node
Welcome to Node.js v14.0.0.
Type ".help" for more information.
> const u = new URL('http://example.com/?a=~')
undefined
> u.toString()
'http://example.com/?a=~'
> u.searchParams.sort()
undefined
> u.toString()
'http://example.com/?a=%7E'
>Per #18, there are reasons why URLSearchParam uses different semantics for stringification, and I don't necessarily want to revisit those, but we should likely give consideration to what the expected behavior should be when URLSearchParam is used to mutate a URL instance. Which of the differing encoding semantics should take precedence?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs concrete proposalMoving the issue forward requires someone to figure out a detailed planMoving the issue forward requires someone to figure out a detailed planneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: api