Skip to content

Commit

Permalink
fix(parse): do not encode userinfo (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
zekth authored Sep 26, 2024
1 parent 33a3129 commit 2ebe20a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ function parse (uri, opts) {
if (gotEncoding && parsed.scheme !== undefined) {
parsed.scheme = unescape(parsed.scheme)
}
if (gotEncoding && parsed.userinfo !== undefined) {
parsed.userinfo = unescape(parsed.userinfo)
}
if (gotEncoding && parsed.host !== undefined) {
parsed.host = unescape(parsed.host)
}
Expand Down
2 changes: 2 additions & 0 deletions test/compatibility.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ test('compatibility Parse', (t) => {
'//[2001:db8::001]:80',
'uri://user:[email protected]:123/one/two.three?q1=a1&q2=a2#body',
'http://user:[email protected]:123/one/space in.url?q1=a1&q2=a2#body',
'http://User:[email protected]:123/one/space in.url?q1=a1&q2=a2#body',
'http://A%[email protected]:123/one/space',
'//[::ffff:129.144.52.38]',
'uri://10.10.10.10.example.com/en/process',
'//[2606:2800:220:1:248:1893:25c8:1946]/test',
Expand Down

0 comments on commit 2ebe20a

Please sign in to comment.