Hi,

I believe I've found a bug in the base method of HTTP::Response. What
I believe to be the correct version is this:

sub base
{
    my $self = shift;
    my $base = $self->header('Content-Base')     ||  # HTTP/1.1
               $self->header('Content-Location') ||  # HTTP/1.1
               $self->header('Base')             ||  # backwards compatability HTTP/1.0
               $self->request->url;
    $base = $HTTP::URI_CLASS->new($base, $self->request->url) unless ref $base;
    $base->abs($self->request->url);
}

The only change is in the last line, where I've added the abs call
with the URL used to make the request. This fixes the problem where a
Content-Location: header contains only a filename like 'index.html'. 
Then the URL returned will not be fully qualified.

Could this go in to the next LWP release?

Hans

Reply via email to