Per: https://github.com/whatwg/url/issues/97
Given the test case:
var m = new url.URL('file:///example/foo');
m.host = 'example.net:81';
The resulting URL is:
URL {
href: file://example.net:81/example/foo
protocol: file:
hostname: example.net
port: 81
pathname: /example/foo
}
The host setter needs to take into consideration the fact that this is a file URL. PR incoming shortly.
It seems like the spec isn't completely decided here though, from the discussions in https://github.com/whatwg/url/issues/97, so it might be worth holding off?
Ok. I can prepare the basic PR but I'll keep an eye out for the spec changes
Awesome. I just want to say that I really love your responsiveness to spec updates; it's important that living standards have living implementations to benefit from these kind of bug fixes, and you've done a great job ensuring that stays the case.
Definitely wanting to make sure we keep up. One favor I would ask: while the new URL parser in Node.js is still experimental, significant changes are easier to make. Once it moves up to a fully supported API, we will need to be more careful about potentially breaking changes. We'll need to make sure that we can go through a proper deprecation cycle for old behavior if necessary which means getting as much advance notice of breaking changes as possible. I know that breaking changes are generally avoided as much as possible in the WHATWG specs but if we can continue to get active heads up when changes are being considered, it would be extremely helpful! I really appreciate the help you've already provided!!
cc @nodejs/url
This has landed in the spec.
Spec: https://github.com/whatwg/url/pull/224
Test: https://github.com/w3c/web-platform-tests/pull/4696
Most helpful comment
Awesome. I just want to say that I really love your responsiveness to spec updates; it's important that living standards have living implementations to benefit from these kind of bug fixes, and you've done a great job ensuring that stays the case.