This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://tools.ietf.org/html/rfc1738#section-3.10 (which is the closest I found to defining the file: scheme) says: > As a special case, <host> can be the string "localhost" or the empty string; this is interpreted as `the machine from which the URL is being interpreted'. Since file://localhost/foo and file:///foo are equivalent, it seems preferable that they parse the same. In the file host state, after > Otherwise, if buffer is the empty string, set state to relative path start state. … consider adding > Otherwise, if buffer is "localhost", set buffer to the empty string, and state to relative path start state.
Per testing I seem to remember this only happened in rebel Opera.
This also happens in Firefox seemingly.
Internet Explorer does this too. I ended up fixing this slightly differently from how you suggested since we also need to account for the input here being case-insensitive so I've just deferred to the host parser. https://github.com/whatwg/url/commit/bb36bd9f035be2e3904ddc8e4e8fd1e756ae8f1e