Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/Dancer2/Core/Role/HasLocation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ sub _build_location {
last;
}

$subdir = $subdir->parent;
# Preserve pre-Path::Tiny traversal behavior: keep walking "up"
# even when current subdir is ".".
$subdir = Path::Tiny::path( $subdir, '..' );

last if $subdir->realpath->stringify eq Path::Tiny->rootdir->stringify;
last if $subdir->absolute->stringify eq Path::Tiny->rootdir->stringify;
}

my $path = $subdir_found ? $subdir : $location;
Expand Down
Loading