-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Labels
needs testsMoving the issue forward requires someone to write testsMoving the issue forward requires someone to write teststopic: api
Description
When setting port state, https://url.spec.whatwg.org/#port-state says:
- Set url’s port to null, if port is url’s scheme’s default port, and to port otherwise
However no corresponding verbiage is included in the process for setting a url scheme. This leads to inconsistent URL states, as illustrated in node.js's current implementation of this standard:
> u1 = new URL('https://foo.com:80')
URL {...}
> u2 = new URL('http://foo.com:443')
URL {...}
> u1.protocol = 'http:'
'http:'
> u2.port = 80
80
> String(u1)
'http://foo.com:80/'
> String(u2)
'http://foo.com/'
u1 and u2 both represent the same URL (scheme, host, port), but u1's port is set to 80, while u2's port is null.
The spec should dictate that when the scheme state is set, the port should be set to null if it matches the default port for that scheme.
Metadata
Metadata
Assignees
Labels
needs testsMoving the issue forward requires someone to write testsMoving the issue forward requires someone to write teststopic: api