Re: Bug with URI::URL

Gisle Aas (gisle@aas.no)
02 Oct 1997 10:45:45 +0200


Rolf Grossmann <grossman@securitas.net> writes:

> I have a problem with the URI::URL class, which I believe to be a bug:
> When using a relative URL that has an absolute base as the base of
> another relative URL, the original base is not honored. The resulting
> URL is relative and therefor cannot be represented as an absolute URL.
> 
> Here's a short test case:
> 
> use LWP; 
> use URI::URL; 
> 
> $x = new URI::URL "http://www/a/b.html"; 
> $y = new URI::URL "c.html", $x; 
> $z = new URI::URL "d/bad.html", $y; 

The base of the URL must be absolute itself.  You should be able to
make this work by using $y->abs instead of $y as base for $z.  I'll
try to fix it for the next release.

Regards,
Gisle


> printf("This is libwww-perl-$LWP::VERSION\n%s\n", $z->abs);
> 
> The result on my system is:
> 
> This is libwww-perl-5.12
> /d/bad.html