summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-12-30 12:59:32 -0600
committerJesse Luehrs <doy@tozt.net>2010-12-30 12:59:32 -0600
commit704152a4ea236ab863664324e535b2d69fc61020 (patch)
tree4a6635724353fbbe11637f648cbbfbe53811a4fe /lib
parent0dd83b75d3172b71afbe2de8dbecad4f83d094b3 (diff)
downloadplack-client-704152a4ea236ab863664324e535b2d69fc61020.tar.gz
plack-client-704152a4ea236ab863664324e535b2d69fc61020.zip
make psgi://foo equivalent to psgi://foo/ (since http does this)
Diffstat (limited to 'lib')
-rw-r--r--lib/Plack/Client.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Plack/Client.pm b/lib/Plack/Client.pm
index 91c7f46..3fd5cf1 100644
--- a/lib/Plack/Client.pm
+++ b/lib/Plack/Client.pm
@@ -44,6 +44,8 @@ sub request {
if ($scheme eq 'psgi') {
my ($app_key, $path) = $self->_parse_request($req->uri->opaque);
+ $path = '/' unless length $path;
+
# to_psgi doesn't like non-http uris
$req->uri($path);
my $env = $req->isa('HTTP::Request') ? $req->to_psgi : $req->env;
@@ -81,7 +83,7 @@ sub _req_from_psgi {
sub _parse_request {
my $self = shift;
my ($req) = @_;
- my ($app, $path) = $req =~ m+^//(.*?)(/.*)$+;
+ my ($app, $path) = $req =~ m{^//([^/]+)(.*)$};
return ($app, $path);
}