httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher H. Laco" <apache-t...@chrislaco.com>
Subject Re: [PATCH] Test & TestRequest pod
Date Thu, 02 Dec 2004 21:34:20 GMT
Stas Bekman wrote:
>  > Of course it should take the necessary precautions for when / is and
>  > isn't included, etc.
> 
> What do you mean? Examples?
> 

Well, let's go with the running sample:

   sub module2url {
      my $module = shift;
      my $scheme = shift || "http";

      Apache::TestRequest::module($module);
      my $config   = Apache::Test::config();
      my $hostport = Apache::TestRequest::hostport($config);
      my $path     = Apache::TestRequest::module2path($module);
      return "$scheme://$hostport$path";
  }

If looks as though module2path() returns the path starting with /.
If we override that with the path from the hashref module2url($url, 
{path => 'mypath'}) we would end up with scheme://host:portmypath 
instead of scheme://host:port/mypath.


Mime
View raw message