File system model

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Sun Jan 20 20:43:37 UTC 2002


On Fri, 18 Jan 2002, Michael Rueger wrote:

> 
> >From a message Bert wrote 4/2/01:
> 
> > Btw, it's always okay to specify the protocol, even in a relative URL
> > like this: "file:foo/bar".
> 
> Actually, I was wrong. RFC 2396 says
> 
>       If the scheme component is defined, indicating that the reference
>       starts with a scheme name, then the reference is interpreted as an
>       absolute URI and we are done.  Otherwise, the reference URI's
>       scheme is inherited from the base URI's scheme component.
> 
>       Due to a loophole in prior specifications [RFC1630], some parsers
>       allow the scheme name to be present in a relative URI if it is the
>       same as the base URI scheme.  Unfortunately, this can conflict
>       with the correct parsing of non-hierarchical URI.  For backwards
>       compatibility, an implementation may work around such references
>       by removing the scheme if it matches that of the base URI and the
>       scheme is known to always use the <hier_part> syntax.  The parser
>       can then continue with the steps below for the remainder of the
>       reference components.  Validating parsers should mark such a
>       misformed relative reference as an error.
> 
> So "file:foo/bar" is invalid, as is even "http:/somedir/somefile".
> Netscape 4 and other browsers tolerate this, while Mozilla nowadays does
> not. I was about to file a bug report but found this:
> 
>         http://bugzilla.mozilla.org/show_bug.cgi?id=22251 
> 
> The "bug" gets reported quite often, as there are a number of web sites
> using such wrong adresses - but the Mozilla developers decided to not
> un-fix the browser but let the page authors fix their pages.

Just to clarify, "foo/bar" *is* a valid relative URL - it's just not
allowed to put the "file:" component before.

-- Bert




More information about the Squeak-dev mailing list