Skip to content

Commit

Permalink
Fixing bug (?) under Mojo 9.x for t/auto_index.t
Browse files Browse the repository at this point in the history
In `before_dispatch` hook rather than falling through if the directory
exists but `auto_index` is disabled explicitly reply `not_found` so
that returns 404 (rather than 500).
  • Loading branch information
fletch authored and briandfoy committed Mar 6, 2023
1 parent d73ab75 commit cbb125e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Mojolicious/Plugin/Directory.pm
Expand Up @@ -71,7 +71,11 @@ sub register {
return;
}

render_indexes( $c, $path, $json ) unless not $auto_index;
if( $auto_index ) {
render_indexes( $c, $path, $json );
} else {
$c->reply->not_found;
}
}
},
);
Expand Down

0 comments on commit cbb125e

Please sign in to comment.