classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: Absolute URL parsing bug


From: Per Bothner
Subject: [cp-patches] Re: Absolute URL parsing bug
Date: Fri, 01 Jul 2005 13:36:10 -0700
User-agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513)

Andrew Haley wrote:
This URL is an absolute URL because its path begins with a "/":

"jar:file:/usr/src/redhat/BUILD/jonas-4.3.3/jonas/output/JONAS_4_3_3/examples/webservices/beans/ws/temp/ejbjars/ws.jar!/META-INF/wsdl/ssbEndpoint.wsdl"

[ An absolute file URL can look like:

   absoluteURI = "file" ":" abs_path
   abs_path = "/" path_segments

That is, there is no need for "//".

I don't see that in any of the specs. Technically, "file:/tmp/foo.html" is not a valid URI, as far as I can tell. I notice that firefox rewrites it (in the navigation bar) to "file:///tmp/foo.html".

Now in practice we may want to allow "file:/tmp/foo.html", but it should be viewed as an unofficial short-hand for "file:///tmp/foo.html".

And indeed, the URL spec in the
SDK docs says 'If the spec's path component begins with a slash
character "/" then the path is treated as absolute...' ]

The *path* is absolute, but the URI isn't.

This matters when resolving a relative URL against a base URI, such as he URL of the containing document.

If we have a base URI "http://bar.com/baz/index.html"; and a reference "/tmp/foo.html" then the resolved URI is "http://bar.com/tmp/foo.html";.

But we parse the spec looking for "//" to determine if a URL is
absolute,

A URL is absolute *only* if it has a "scheme".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]