- From: Benjamin E. Coe <notifications@github.com>
- Date: Wed, 20 Sep 2017 18:55:21 +0000 (UTC)
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 20 September 2017 18:58:44 UTC
I was digging into a [Windows bug in Node](https://github.com/nodejs/node/pull/15490) and found an inconsistency between Chrome's implementation of the URL spec and what's written in [file-slash-state](https://url.spec.whatwg.org/#file-slash-state). Reading the spec, it sounds like if I resolve: ```bash new URL('/C:/foo', 'file:///D:/bar') ``` I would expect the URL to resolve as: ```bash /D:/foo ``` ## Chrome's Parse: ```js new URL('/C:/foo', 'file:///D:/bar') URL {href: "file:///C:/foo", origin: "file://", protocol: "file:", username: "", password: ""} ``` ## Node's Parse ```js new URL('/C:/foo', 'file:///D:/bar') { href: file:///D:/C:/foo protocol: file: } ``` _wow, that's really wrong definitely should be fixed._ ## Path Forward It feels to me like Chrome's implementation is the most reasonable; if I resolve a URL `C:/foo/bar` it doesn't really make sense to me that I'd end up with a URL `D:/foo/bar` this is almost surely pointing to an invalid file path. It might be worth updating this section of the spec to reflect Chrome's implementation (it might just be that myself and @bmeck are reading it wrong). CC: @bmeck, @TimothyGu, @domenic @annevk -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/345
Received on Wednesday, 20 September 2017 18:58:44 UTC