Error result when url using custom protocol in browser
loynoir opened this issue · 4 comments
loynoir commented
Test in browser
Line 40 in 3fb24bb
Expected
normalizeUrl=(await import('https://cdn.jsdelivr.net/npm/normalize-url@7.0.1/index.js')).default
normalizeUrl('sindre://www.sorhus.com')
"sindre://www.sorhus.com"
Actual
normalizeUrl=(await import('https://cdn.jsdelivr.net/npm/normalize-url@7.0.1/index.js')).default
normalizeUrl('sindre://www.sorhus.com')
"sindre:/www.sorhus.com"
Related rejected fork
loynoir commented
Node
> new URL("sindre://www.sorhus.com").protocol
'sindre:'
> new URL("sindre://www.sorhus.com").host
'www.sorhus.com'
> new URL("sindre://www.sorhus.com").pathname
''
Google Chrome 92
> new URL("sindre://www.sorhus.com").protocol
"sindre:"
> new URL("sindre://www.sorhus.com").host
""
> new URL("sindre://www.sorhus.com").pathname
"//www.sorhus.com"
Mozilla Firefox 90
> new URL("sindre://www.sorhus.com").protocol
"sindre:"
> new URL("sindre://www.sorhus.com").host
""
> new URL("sindre://www.sorhus.com").pathname
"//www.sorhus.com"
loynoir commented
sindresorhus commented
You should report this bug to https://github.com/nodejs/node if it's still an issue.