From: Tomas Doran Date: Sun, 27 Mar 2011 10:38:17 +0000 (+0100) Subject: Fix the conditional here. X-Git-Tag: 5.89003~82 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=7e58c6275aeae6b53fb5be463fe1defbd31b7295 Fix the conditional here. We do always need a trailing slash if we have a server path and either just a /, or no uri at all (e.g. http://localhost). This matters when we're mounted at a non-root path, as cataltst needs to see http://localhost/non_root_path/, rather than http://localhost/non_root_path, otherwise we'll try to resolve /non_root path as an action. --- diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index a976811..e04bdbf 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -325,7 +325,7 @@ sub _remote_request { if ($server->path) { # If request path is '/', we have to add a trailing slash to the # final request URI - my $add_trailing = $request->uri->path eq '/'; + my $add_trailing = ($request->uri->path eq '/' || $request->uri->path eq '') ? 1 : 0; my @sp = split '/', $server->path; my @rp = split '/', $request->uri->path;