author | Alberto Bertogli
<albertito@blitiri.com.ar> 2020-06-09 10:52:54 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2020-06-09 10:52:54 UTC |
parent | c797d7eb0075c4c09d73505a90c2ef31d28e0056 |
server/dir.go | +5 | -5 |
diff --git a/server/dir.go b/server/dir.go index bb809b7..ec9b215 100644 --- a/server/dir.go +++ b/server/dir.go @@ -53,14 +53,14 @@ func (fs *FileSystem) Open(name string) (http.File, error) { return nil, err } - f = wrappedFile{File: f, name: name, opts: &fs.opts} - - if ListingEnabled(&fs.opts, name) { + // If it's not a directory, let it be. + if s, _ := f.Stat(); s == nil || !s.IsDir() { return f, nil } - // If it's not a directory, let it be. - if s, _ := f.Stat(); s == nil || !s.IsDir() { + f = wrappedFile{File: f, name: name, opts: &fs.opts} + + if ListingEnabled(&fs.opts, name) { return f, nil }