Closed Hamper closed 4 years ago
It's a bug in the Node.js implementation. Try using URLSearchParams. The URL is normalized according to the spec. If servers don't follow the spec then it's not our problem.
Duplicate of #1113
According to https://tools.ietf.org/html/rfc3986#section-2.3 tilde is unreserved and should not encoded by URI producers.
querystring.escape() - does not escape tilde new URL() - does not escape tilde encodeURIComponent() - does not escape tilde encodeURI() - does not escape tilde browsers - does not escape tilde, normalize %7E as ~ before sending got 10 - does not escape tilde
got 11 escapes tilde but should not according to RFC
Got doesn't do this. It's the native URLSearchParams
. And, according to the WHATWG implementation the behavior is correct (see the original issue). I'll open a Node.js issue.
Describe the bug
Invalid extra escape for urls only in got v11, not in v10
Actual behavior
Got escapes some symbols like
~
in url but should not do this because some servers don't parse such escaped symbolsExpected behavior
Symbols in URLs like
~
must not be escapedCode to reproduce
same result with
new URL(testURL))
in got parametersChecklist