Fix the conditional here.
Tomas Doran [Sun, 27 Mar 2011 10:38:17 +0000 (11:38 +0100)]
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.

lib/Catalyst/Test.pm

index a976811..e04bdbf 100644 (file)
@@ -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;