Skip to content

Commit

Permalink
Allow DirectoryIndex to find index page in root pages/ dir:
Browse files Browse the repository at this point in the history
It seems DirectoryIndex, when the readin() sub doesn't find a page
for '', adds a slash, so it then looks for '/index'. This is wrong
when acting on the root pages/ directory, so now we check if the
page is blank, and if so skip the slash.

Came to light when attempting to serve a root index.html page via
PageTables.
  • Loading branch information
Josh Lavin committed May 2, 2014
1 parent 6d17d75 commit 2c9c489
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Vend/Page.pm
Expand Up @@ -127,7 +127,8 @@ sub display_page {
# Try one last time for page with index
if(! defined $page and $Vend::Cfg->{DirectoryIndex}) {
my $try = $name;
$try =~ s!/*$!/$Vend::Cfg->{DirectoryIndex}!;
my $slash = length($try) ? '/' : '';
$try =~ s!/*$!$slash$Vend::Cfg->{DirectoryIndex}!;
$page = readin($try);
}

Expand Down

0 comments on commit 2c9c489

Please sign in to comment.