sindresorhus / normalize-url

Normalize a URL
MIT License
837 stars 123 forks source link

Semicolon in the hostname is misinterpreted as a valid hostname on Firefox #141

Closed here-nerd closed 3 years ago

here-nerd commented 3 years ago

For example, I do

normalizeUrl('asdfas;45')

Expect: 'Invalid URL'

Actual: on Chrome --> 'Invalid URL' on Firefox 89.0.2 --> 'http://asdfas;45'

sindresorhus commented 3 years ago

You're gonna have to open an issue on Firefox instead. We're just using new URL.

here-nerd commented 3 years ago

Thank you @sindresorhus for a quick reply. I did a quick test on Firefox using new URL as you mentioned. It seems Firefox handles it correctly: image Could you please reopen the issue because it doesn't seem to be a Firefox issue?

here-nerd commented 3 years ago

I wanted to help so I dug a little deeper. Apparently, it a semicolon in URL's hostname is a feature, not a bug. @sindresorhus, you are right that it's not a normailize-url issue. A semicolon is for Web Bundles' new scheme which is already supported by Safari and Firefox. Chrome is lacking behind, see

https://chromium-review.googlesource.com/c/chromium/src/+/2226248/

We can close the issue.