<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26387</bug_id>
          
          <creation_ts>2014-07-19 13:53:12 +0000</creation_ts>
          <short_desc>file: Map &quot;localhost&quot; to empty host in file: URLs?</short_desc>
          <delta_ts>2015-08-13 09:37:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Sapin">simon.sapin</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>rubys</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109104</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2014-07-19 13:53:12 +0000</bug_when>
    <thetext>http://tools.ietf.org/html/rfc1738#section-3.10 (which is the closest I found to defining the file: scheme) says:

&gt; As a special case, &lt;host&gt; can be the string &quot;localhost&quot; or the empty string; this is interpreted as `the machine from which the URL is being interpreted&apos;.

Since file://localhost/foo and file:///foo are equivalent, it seems preferable that they parse the same.

In the file host state, after
&gt; Otherwise, if buffer is the empty string, set state to relative path start state.

… consider adding
&gt; Otherwise, if buffer is &quot;localhost&quot;, set buffer to the empty string, and state to relative path start state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109320</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-27 17:54:52 +0000</bug_when>
    <thetext>Per testing I seem to remember this only happened in rebel Opera.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120996</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-15 14:56:16 +0000</bug_when>
    <thetext>This also happens in Firefox seemingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122585</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-13 09:37:30 +0000</bug_when>
    <thetext>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&apos;ve just deferred to the host parser.

https://github.com/whatwg/url/commit/bb36bd9f035be2e3904ddc8e4e8fd1e756ae8f1e</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>