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 21378 - parsing "file:" URL uses base URL scheme instead
Summary: parsing "file:" URL uses base URL scheme instead
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-23 06:54 UTC by Geoff Richards
Modified: 2013-04-09 13:37 UTC (History)
1 user (show)

See Also:


Attachments

Description Geoff Richards 2013-03-23 06:54:53 UTC
I'm trying to implement the URL parsing algorithm, but it seems to run
into trouble in the following situation, unless I'm just misunderstanding.

* Parsing input "file:anything" with no state override and no base URL.
* After ':' is found in the scheme state, step 2.3 switches to relative state.
* The next thing that happens, as far as I can see, is that the relative state
  overwrites the 'file' scheme with the base URL's scheme.

It looks like this would always break when, e.g., parsing a "file:" URL in
a page accessed via an "http:" URL, and I don't know what is supposed to
happen if a base URL isn't provided.
Comment 1 Anne 2013-04-09 13:27:55 UTC
Well if a base URL is not provided the scheme cannot be "file". But yes, it seems we should special case "file" in the /relative state/.