From e953bc6820223abb7f3386f15f88b3aa41883370 Mon Sep 17 00:00:00 2001 From: Vincent Le Goff Date: Wed, 25 Sep 2024 17:43:01 +0200 Subject: [PATCH] fix(parse): do not encode userinfo --- index.js | 3 --- test/compatibility.test.js | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6a0b809..52b2e88 100644 --- a/index.js +++ b/index.js @@ -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) } diff --git a/test/compatibility.test.js b/test/compatibility.test.js index da4cbd2..89886d1 100644 --- a/test/compatibility.test.js +++ b/test/compatibility.test.js @@ -17,6 +17,8 @@ test('compatibility Parse', (t) => { '//[2001:db8::001]:80', 'uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body', 'http://user:pass@example.com:123/one/space in.url?q1=a1&q2=a2#body', + 'http://User:Pass@example.com:123/one/space in.url?q1=a1&q2=a2#body', + 'http://A%3AB@example.com: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',