develooper Front page | perl.libwww | Postings from January 2002

Double slash in a URI: legal or not?

Thread Next
Hans de Graaff
January 6, 2002 08:01
Double slash in a URI: legal or not?
Message ID:

use URI;
my $u1 = URI->new_abs("..//file.html", "");
print "$u1\n";

The above bit of code prints
instead of what I would expect:
For those of you squinting, the first one has a double slash before
file, the second one hasn't. 

RFC 2396 seems to indicate that in path segments only a single slash
is legal, so I feel that the URI class should either clean up the URI
by changing the double slash to a single slash, or it should complain
about a malformed URI. As far as I can tell nothing happens and a URI
with a double slash is returned.

In case people wonder why I care: I'm getting Checkbot bug reports of
people being bitten by this. What happens is that they get a runaway
Checkbot process checking URIs with ever more slashes in them... More
information on Checkbot is at <>.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About