hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: Relative URIs strike again
Date Thu, 30 Jan 2003 13:44:12 GMT
> But what exactly is the correct behaviour? At least two major browsers 
> implement this behaviour in a different way than you would immediately 
> expect. This could just be a bug in them, or it could be a legitimate 
> ambiguity. To clarify, which of the following do you interpret as the 
> correct behaviour?
>
> ["base" + "rel" = "abs"]
> A:
> "http://www.foo.com/foop.html" + "" = "http://www.foo.com/foop.html"
> "http://www.foo.com/foop.html" + "#" = "http://www.foo.com/foop.html"
>
> B:
> "http://www.foo.com/foop.html" + "" = "http://www.foo.com/foop.html"
> "http://www.foo.com/foop.html" + "#" = "http://www.foo.com/foop.html#"

I believe A is correct.  The RFC is a little vague(particularly when 
there is a query) in this case as it just says to use "the current 
document".

> There are more actual possible permutations than A and B but they are 
> two likely groups of choices.
>
> I wrote a little snippet[1] to test the URI behaviour and got the 
> following:
>
> HttpClient:
> "http://www.foo.com/foop.html" + "" = "http://www.foo.com/foop.html"
> "http://www.foo.com/foop.html" + "#" = "http://www.foo.com/foop.html"
>
> It would seem that HttpClient is doing A. Note that I just did a cvs 
> update right now and didn't apply any patches, so I may have missed 
> some code that is pending.

This behavior looks correct. It seems that the empty case was fixed 
yesterday.

> Incidentally, when I tried a relative URI of "#foop" I got the 
> following:
>
> "http://www.foo.com/foop.html" + "#foop" = 
> "http://www.foo.com/foop.html"
>
> Surely this is incorrect?

This is something I ran across as well.  The fragment is not dropped, 
but is left out of the standard URI.  To get the full URI you have to 
use URI.getURIReference().

Mike


Mime
View raw message