Author: stas Date: Mon Dec 6 21:19:39 2004 New Revision: 110080 URL: http://svn.apache.org/viewcvs?view=rev&rev=110080 Log: new wrapper Apache::TestRequest::module2url to simplify handling of vhosts in the client. Contributed by: "Christopher H. Laco" <apache-test chrislaco.com>
Modified: httpd/test/trunk/perl-framework/Apache-Test/Changes httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm Modified: httpd/test/trunk/perl-framework/Apache-Test/Changes Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/Changes?view=diff&rev=110080&p1=httpd/test/trunk/perl-framework/Apache-Test/Changes&r1=110079&p2=httpd/test/trunk/perl-framework/Apache-Test/Changes&r2=110080 ============================================================================== --- httpd/test/trunk/perl-framework/Apache-Test/Changes (original) +++ httpd/test/trunk/perl-framework/Apache-Test/Changes Mon Dec 6 21:19:39 2004 @@ -8,6 +8,10 @@ =item 1.17-dev +new wrapper Apache::TestRequest::module2url to simplify handling of +vhosts in the client. ["Christopher H. Laco" <apache-test +chrislaco.com>] + resolve -T taint issues: [Stas] - untaint $cmd in Apache::TestConfig::open_cmd - fix the tainting of @INC (by untaintinig top_dir variable) Modified: httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm?view=diff&rev=110080&p1=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm&r1=110079&p2=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm&r2=110080 ============================================================================== --- httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm (original) +++ httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm Mon Dec 6 21:19:39 2004 @@ -107,6 +107,21 @@ return $path; } +sub module2url { + my $module = shift; + my $opt = shift || {}; + my $scheme = $opt->{scheme} || 'http'; + my $path = $opt->{path} || module2path($module); + + Apache::TestRequest::module($module); + + my $config = Apache::Test::config(); + my $hostport = hostport($config); + + $path =~ s|^/||; + return "$scheme://$hostport/$path"; +} + sub user_agent { my $args = [EMAIL PROTECTED];