URL constructor does not support unknown protocols
Reported by
m...@bfred.it,
Jun 20 2017
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36
Steps to reproduce the problem:
1. Execute: new URL('git://github.com').hostname
What is the expected behavior?
It should return "github.com"
What went wrong?
It returns ""
Did this work before? No
Does this work in other browsers? N/A
Chrome version: 59.0.3071.104 Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 26.0 r0
Firefox 54 matches this buggy behavior.
Safari 10.1 works correctly.
Node's URL implementation works correctly.
Node's "whatwg-url" package also works correctly.
,
Jun 20 2017
,
Jun 20 2017
DoResolveRelative() used by KURL has a special path for schemes not listed in kStandardURLSchemes. Ones with "git" scheme enter that path and cannot recognize that part as hostname.
,
Jun 20 2017
,
Feb 8 2018
,
Nov 6
Repro website: https://felixfbecker.github.io/whatwg-url-custom-host-repro/ Filed on https://github.com/webcompat/web-bugs/issues/19792 Files on Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=902253 Specific test case added in https://github.com/web-platform-tests/wpt/pull/13516 (although also already covered in existing tests) Firefox and Chrome both misbehave, while Edge, Safari, Node and whatwg-url behave spec-compliant. This makes the URL API unreliable to use for generic URL parsing and always requires us to polyfill it (which is pretty big). |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by m...@bfred.it
, Jun 20 2017