mirror of https://github.com/fafhrd91/actix-web
show index only if C::show_index() returns true
This commit is contained in:
parent
02a75cc239
commit
d92873eebd
|
@ -749,7 +749,7 @@ impl<C: StaticFileConfig> StaticFiles<C> {
|
||||||
if path.is_dir() {
|
if path.is_dir() {
|
||||||
if let Some(redir_index) = C::index_file() {
|
if let Some(redir_index) = C::index_file() {
|
||||||
path.push(redir_index);
|
path.push(redir_index);
|
||||||
if !path.exists() {
|
if C::show_index() && !path.exists() {
|
||||||
path.pop();
|
path.pop();
|
||||||
let dir = Directory::new(self.directory.clone(), path);
|
let dir = Directory::new(self.directory.clone(), path);
|
||||||
return Ok(C::directory_listing(&dir, &req)?.into())
|
return Ok(C::directory_listing(&dir, &req)?.into())
|
||||||
|
|
Loading…
Reference in New Issue