On Tue, 16 May 2000, Rob Tanner wrote:

> Hello,
> 
> I do the following:
> 
> my $parsed_uri = $r->parsed_uri;
> my $r_scheme   = $parsed_uri->scheme;
> my $r_host     = $parsed_uri->hostinfo;
> my $r_rpath    = $parsed_uri->rpath;
> my $r_path     = $parsed_uri->path;
> 
> 
> The result is that the scalars $r_scheme and $r_host are empty, and
> only $r_path and $r_rpath have data in them (and the data is correct).

that's because $r->parsed_uri is the parse uri from the http request,
which does not contain scheme/hostname/port, unless the request is a proxy
request.

> But, if instead I do,
> 
> my $me = Apache::URI->parse($r);

that's a shortcut for building "self urls", if you don't specify a url,
the Apache::URI is filled in with everything it can dig out of the
request object (including scheme/hostname/port)

Reply via email to