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.
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;