[Web-SIG] [issue1432] Strange behavior of urlparse.urljoin

James Y Knight foom at fuhm.net
Fri Aug 8 01:01:36 CEST 2008


On Aug 7, 2008, at 6:17 PM, O.R.Senthil Kumaran wrote:
> This bug report is on particular behavior of urlparse.urljoin. The  
> way it is
> currently coded is, compliant with RFC2396

RFCs in the web area are often a meaningless waste of paper, but it's  
not always clear which ones are and which aren't. So please check  
things like this against actual browsers. Being compliant with a spec  
but different from the implementation in the browsers is really pretty  
useless.

In this case, however, Safari and Firefox seem to follow your two  
tests at least, so that probably means RFC3986 is good to follow. I'd  
actually bet that common web browsers have /always/ had this behavior,  
and that the previous RFCs were buggy, although I admit I haven't gone  
back and tested netscape 1.1 or anything.

I tested using the following test fragment. The two links I got were:  
http://a/b/c/d;p?y and http://a/b/c/;x which corresponds with your  
suggested change. So, if you asked me, I'd say it was a bug fix,  
because it's currently wrong when you compare against the thing that  
really counts: browsers.

<html>
<head>
<base href="http://a/b/c/d;p?q#f">
</head>
<body>
<a href="?y">?y</a><br>
<a href=";x">;x</a><br>

James


More information about the Web-SIG mailing list