Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 46694
Status: rejected
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: TRENDELS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.826
Fixed in: (no value)



Subject: HTTP::Daemon: get_request() builds, but never returns absolute request URI
Hi there, the get_request() method of HTTP::Daemon::ClientConn builds the URI for the request object like this: $uri = $HTTP::URI_CLASS->new($uri, $self->daemon->url); where "$uri" is the path from the request after the HTTP method (as in "GET /"), and $self->daemon->url is the absolute URL of the server. Now the the 2nd argument to URI->new() is supposed to be the scheme, so the URI that is returned here is *always a relative one*! I think this is a bug, since "$self->daemon->url" explicitly builds an absolute URI, even resolving the hostname, etc. I suppose the line should read $uri = $HTTP::URI_CLASS->new_abs($uri, $self->daemon->url); ?
On Fri Jun 05 16:16:52 2009, TRENDELS wrote: Show quoted text
> Hi there, > > the get_request() method of HTTP::Daemon::ClientConn builds the URI for > the request object like this: > > $uri = $HTTP::URI_CLASS->new($uri, $self->daemon->url); > > where "$uri" is the path from the request after the HTTP method (as in > "GET /"), and $self->daemon->url is the absolute URL of the server. > > Now the the 2nd argument to URI->new() is supposed to be the scheme, so > the URI that is returned here is *always a relative one*! > > I think this is a bug, since "$self->daemon->url" explicitly builds an > absolute URI, even resolving the hostname, etc. > > I suppose the line should read > > $uri = $HTTP::URI_CLASS->new_abs($uri, $self->daemon->url); > > ?
Actually, no. The server implementation ought to be able to see if a relative or absolute URL was passed in on the request line. If the server implements a proxy server it will look for absolute URIs. The $self->daemon->url is just passed in to provide the 'scheme', so it could as well has been $self->daemon->url->scheme. Currently I guess this will always be 'http', but It could potentially become 'https' at some point.