From 704152a4ea236ab863664324e535b2d69fc61020 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 30 Dec 2010 12:59:32 -0600 Subject: make psgi://foo equivalent to psgi://foo/ (since http does this) --- lib/Plack/Client.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3-54-g00ecf