Skip to content

Commit 1adc113

Browse files
committed
uri decode host in url
1 parent 41ed84f commit 1adc113

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,8 @@ function parseUrl(url) {
473473
return { url: { searchParams: new Map() } }
474474

475475
let host = url
476-
host = host.slice(host.indexOf('://') + 3)
477-
host = host.split(/[?/]/)[0]
478-
host = host.slice(host.indexOf('@') + 1)
476+
host = host.slice(host.indexOf('://') + 3).split(/[?/]/)[0]
477+
host = decodeURIComponent(host.slice(host.indexOf('@') + 1))
479478

480479
return {
481480
url: new URL(url.replace(host, host.split(',')[0])),

0 commit comments

Comments
 (0)