This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21178 - Authority state algorithm has an error in the specification
Summary: Authority state algorithm has an error in the specification
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-03 11:35 UTC by Peter Occil
Modified: 2013-03-03 13:14 UTC (History)
1 user (show)

See Also:


Attachments

Description Peter Occil 2013-03-03 11:35:36 UTC
I think there is an error in this rule:
-----
[Authority state]
If c is one of EOF code point, "/", "\", "?", and "#", 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 '/' character the buffer will contain "example.com", or 11 characters.  So we move back 11 characters so that the pointer now points to the first "e".  But after we move to the next state the parser now reads the "x", 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, "/", "\", "?", and "#", decrease pointer by __one plus__ the number of code points in buffer, set buffer to the empty string, and state to host state.
-----