summaryrefslogtreecommitdiffstats
path: root/lib/Plack/Client.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plack/Client.pm')
-rw-r--r--lib/Plack/Client.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Plack/Client.pm b/lib/Plack/Client.pm
index d97f44c..5a2abb4 100644
--- a/lib/Plack/Client.pm
+++ b/lib/Plack/Client.pm
@@ -41,8 +41,15 @@ sub request {
my $scheme = $req->uri->scheme;
my $app;
if ($scheme eq 'psgi-local') {
- $req->uri->path('/') unless length $req->uri->path;
- $app = $self->app_for($req->uri->authority);
+ if ($req->isa('Plack::Request')) {
+ $req->env->{REQUEST_URI} = '/' unless length $req->request_uri;
+ }
+ else {
+ $req->uri->path('/') unless length $req->uri->path;
+ }
+ my $app_name = $req->uri->authority;
+ $app_name =~ s/:.*//;
+ $app = $self->app_for($app_name);
$app = Plack::Middleware::ContentLength->wrap($app);
}
elsif ($scheme eq 'http' || $scheme eq 'https') {