For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > September 2005 > URI::canonical method fails to canonicalize "http:://hamlug.org/../../../../&quo









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author URI::canonical method fails to canonicalize "http:://hamlug.org/../../../../&quo
xuqy@jlu.edu.cn

2005-09-27, 7:56 am

I found a strange URI when I examined the crawling log of a web crawler
I recently wrote in Perl: "http://hamlug.org/../../../../". When I
paste it into web browser's address column, it was transformed to
"http://hamlug.org/", which is obviously correct. However, when I wrote
a simple test script as follows:

#!/usr/bin/perl -w
use strict;

my $rawURL = "http://hamlug.org/../../../../";
my $url = URI->new($rawURL)->canonical->as_string;
print $url, "\n";


To my great astonishment, URI::canonical method does nothing to my
$rawURL.
What is the reason?
Does there exist some module to tackle this?

Brian McCauley

2005-09-27, 7:56 am

xuqy@jlu.edu.cn wrote:

> I found a strange URI when I examined the crawling log of a web crawler
> I recently wrote in Perl: "http://hamlug.org/../../../../". When I
> paste it into web browser's address column, it was transformed to
> "http://hamlug.org/", which is obviously correct.


Ah, it may be _obvious_ but is is _actually_ correct?

In other words has RFC2396 actually been superceded?

See previous discussion...

http://groups.google.com/group/comp...752d47cb623154a

Alan J. Flavell

2005-09-27, 6:59 pm

On Tue, 27 Sep 2005, Brian McCauley wrote:

> In other words has RFC2396 actually been superceded?


STD1 does not show it as having been superseded!

> See previous discussion...


Yes, but where -is- this mooted draft? I don't find anything
which would match it in the place where internet drafts seem to
be stashed these days ( http://www.ietf.org/internet-drafts/ ).

Brian McCauley

2005-09-28, 8:06 am

Alan J. Flavell wrote:

> Yes, but where -is- this mooted draft?


The links to it in the previous thread are still valid.

http://www.gbiv.com/protocols/uri/r...is-07.html#path
http://www.gbiv.com/protocols/uri/r...ve-dot-segments

> I don't find anything
> which would match it in the place where internet drafts seem to
> be stashed these days ( http://www.ietf.org/internet-drafts/ ).


Well its expiry was March 2005, maybe they don't keep expired ones.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com