<?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>21178</bug_id>
          
          <creation_ts>2013-03-03 11:35:36 +0000</creation_ts>
          <short_desc>Authority state algorithm has an error in the specification</short_desc>
          <delta_ts>2013-03-03 13:14:39 +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>PC</rep_platform>
          <op_sys>Windows NT</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="Peter Occil">poccil</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83908</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Occil">poccil</who>
    <bug_when>2013-03-03 11:35:36 +0000</bug_when>
    <thetext>I think there is an error in this rule:
-----
[Authority state]
If c is one of EOF code point, &quot;/&quot;, &quot;\&quot;, &quot;?&quot;, and &quot;#&quot;, decrease pointer by the number of code points in buffer, set buffer to the empty string, and state to host state.
-----
This is because if we take the following URL:

http://example.com/path

In the Authority state when we reach the last &apos;/&apos; character the buffer will contain &quot;example.com&quot;, or 11 characters.  So we move back 11 characters so that the pointer now points to the first &quot;e&quot;.  But after we move to the next state the parser now reads the &quot;x&quot;, or the second character in the host.  This is obviously not correct.  So I suggest the following to correct this:

-----
[Authority state]
If c is one of EOF code point, &quot;/&quot;, &quot;\&quot;, &quot;?&quot;, and &quot;#&quot;, decrease pointer by __one plus__ the number of code points in buffer, set buffer to the empty string, and state to host state.
-----</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83909</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-03 13:14:39 +0000</bug_when>
    <thetext>Thank you!

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

    </bug>

</bugzilla>