summaryrefslogtreecommitdiffstats
path: root/lib/Plack/Client.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-01-11 13:57:50 -0600
committerJesse Luehrs <doy@tozt.net>2011-01-11 14:02:47 -0600
commit935312b7f10857f0ece01697355ec7bf2247e461 (patch)
tree8c8848f165d4fa5dd9d3171b3a634cf371fd43c2 /lib/Plack/Client.pm
parent811c7f969dba4962943550c0b74e5ad179860683 (diff)
downloadplack-client-935312b7f10857f0ece01697355ec7bf2247e461.tar.gz
plack-client-935312b7f10857f0ece01697355ec7bf2247e461.zip
just save the entire original uri
Diffstat (limited to 'lib/Plack/Client.pm')
-rw-r--r--lib/Plack/Client.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Plack/Client.pm b/lib/Plack/Client.pm
index a3f2211..813351c 100644
--- a/lib/Plack/Client.pm
+++ b/lib/Plack/Client.pm
@@ -227,8 +227,8 @@ sub _http_request_to_env {
my $self = shift;
my ($req) = @_;
- my $scheme = $req->uri->scheme;
- my $authority = $req->uri->authority;
+ my $scheme = $req->uri->scheme;
+ my $original_uri = $req->uri->clone;
# hack around with this - psgi requires a host and port to exist, and
# for the scheme to be either http or https
@@ -253,9 +253,7 @@ sub _http_request_to_env {
# work around http::message::psgi bug - see github issue 150 for plack
$env->{CONTENT_LENGTH} ||= length($req->content);
- $env->{'plack.client.url_scheme'} = $scheme;
- $env->{'plack.client.authority'} = $authority
- if defined $authority;
+ $env->{'plack.client.original_uri'} = $original_uri;
return $env;
}
@@ -264,9 +262,9 @@ sub _app_from_request {
my $self = shift;
my ($req) = @_;
- my $scheme = $req->env->{'plack.client.url_scheme'} || $req->uri->scheme;
+ my $uri = $req->env->{'plack.client.original_uri'} || $req->uri;
- my $backend = $self->backend($scheme);
+ my $backend = $self->backend($uri);
my $app = $backend->app_from_request($req);
croak "Couldn't find app" unless $app;