- Version: 12.13.1
- Platform: all
- Subsystem: url
Instantiating a new WHATWG URL with a base option, and a relative URL starting with a double slash ends up with the base option being ignored.
How to reproduce
const foo = new URL('//foo/bar', 'http://fake');
Expected result
URL {
href: 'http://fake//foo/bar',
origin: 'http://fake',
protocol: 'http:',
username: '',
password: '',
host: 'fake',
hostname: 'fake',
port: '',
pathname: '//foo/bar',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
Actual result
URL {
href: 'http://foo/bar',
origin: 'http://foo',
protocol: 'http:',
username: '',
password: '',
host: 'foo',
hostname: 'foo',
port: '',
pathname: '/bar',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
Instantiating a new WHATWG URL with a base option, and a relative URL starting with a double slash ends up with the base option being ignored.
How to reproduce
Expected result
Actual result