X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;fp=lib%2FCatalyst%2FTest.pm;h=a2c27f735ebcc728cd677c9f1c573b2378cd0eb4;hp=e04bdbff5649db5f93af18043849db20fcfb8f06;hb=555c9ff7dd2cf2652f8bb37766a0100efdcb7c5a;hpb=bad031b8949494062bf54f93cc2d78de1fcda052 diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index e04bdbf..a2c27f7 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -308,6 +308,7 @@ my $agent; sub _remote_request { require LWP::UserAgent; + local $Plack::Test::Impl = 'ExternalServer'; my $request = Catalyst::Utils::request( shift(@_) ); my $server = URI->new( $ENV{CATALYST_SERVER} ); @@ -342,13 +343,7 @@ sub _remote_request { } } - $request->uri->scheme( $server->scheme ); - $request->uri->host( $server->host ); - $request->uri->port( $server->port ); - $request->uri->path( $server->path . $request->uri->path ); - unless ($agent) { - $agent = LWP::UserAgent->new( keep_alive => 1, max_redirect => 0, @@ -362,7 +357,16 @@ sub _remote_request { $agent->env_proxy; } - return $agent->request($request); + my $ret; + test_psgi + ua => $agent, + uri => $server, + client => sub { + my ($psgi_app) = @_; + $ret = $psgi_app->($request); + }; + + return $ret; } for my $name (qw(local_request remote_request)) {