Permalink
Browse files

Use catfile in the right place

We need to catfile the filesystem path, not the web path.  The other "worked"
on unix, this is better overall.
  • Loading branch information...
afresh1 committed Dec 2, 2012
1 parent 26f8c5a commit 043c1b5680b1919f16f05bf1e598379a9c9432fb
Showing with 2 additions and 3 deletions.
  1. +2 −3 OpenBSDtracker
View
@@ -101,11 +101,10 @@ app->hook( before_dispatch => sub {
my $rel = $stash->{path} || $tx->req->url->path->clone->canonicalize;
# Append the default file (that I want) if there is a trailing /
- $rel = catfile split( '/', $rel ), $default_file
- if substr( $rel, -1 ) eq '/';
+ $rel .= $default_file if substr( $rel, -1 ) eq '/';
for my $path ( @{ app->static->paths } ) {
- my $file = catfile $path, $rel;
+ my $file = catfile $path, split( '/', $rel );
if ( -d $file ) {
next unless -e catfile $file, $default_file; # no file disclsure
$tx->redirect_to("$rel/");

0 comments on commit 043c1b5

Please sign in to comment.