show index only if C::show_index() returns true

This commit is contained in:
Eon S. Jeon 2018-12-31 09:34:36 +09:00
parent 02a75cc239
commit d92873eebd
1 changed files with 1 additions and 1 deletions

View File

@ -749,7 +749,7 @@ impl<C: StaticFileConfig> StaticFiles<C> {
if path.is_dir() {
if let Some(redir_index) = C::index_file() {
path.push(redir_index);
if !path.exists() {
if C::show_index() && !path.exists() {
path.pop();
let dir = Directory::new(self.directory.clone(), path);
return Ok(C::directory_listing(&dir, &req)?.into())