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 27687 - Make leading/trailing whitespace and leading colons in pathnames non-conforming
Summary: Make leading/trailing whitespace and leading colons in pathnames non-conforming
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: Unsorted
Assignee: Sam Ruby
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-23 18:45 UTC by Sam Ruby
Modified: 2015-08-14 12:22 UTC (History)
4 users (show)

See Also:


Attachments

Description Sam Ruby 2014-12-23 18:45:47 UTC
urltestdata.txt has the following tests that don't match the production rules for valid URIs but don't produce any conformance errors.  This can be fixed with two changes:

A parse error if leading/trailing white space is present in:

https://url.spec.whatwg.org/#concept-basic-url-parser

A parse error if a colon is present in:

https://url.spec.whatwg.org/#relative-path-start-state

 - - -

The corresponding places where the rewritten parser would have to change would be:

https://specs.webplatform.org/url/webspecs/develop/#concept-basic-url-parser
https://specs.webplatform.org/url/webspecs/develop/#path
Comment 1 Sam Ruby 2014-12-24 14:30:21 UTC
Here are the tests from urltestdata.txt:

    "\t :foo.com \n"
    " foo.com "
    " \t"
    ":foo.com/"
    ":"
    ":a"
    ":/"
    ":#"
    ":23"
    "::"
    "::23"

Based on discussions with annevk, this should be fixed in https://specs.webplatform.org/url/webspecs/develop/#relative-url instead; in the description for row #4, add a check for the first segment containing a colon and indicating a conformance error if one is found.
Comment 3 Sam Ruby 2015-06-18 11:34:40 UTC
Fix was only applied to webspecs
Comment 4 Anne 2015-08-14 12:22:33 UTC
Thank you. It's not entirely clear to me why a leading colon is problematic, but I've fixed the other missing parse errors and some. If you find out why a leading colon is problematic a GitHub issue would be appreciated.

https://github.com/whatwg/url/commit/0bae5e5608bfc6132937f8f28388c6f796c9a846