fs: Fix empty media type for directory index pages

This commit is contained in:
Adnan Maolood 2021-03-20 13:33:13 -04:00
parent fffe86680e
commit a40b5dcd0b

3
fs.go
View File

@ -151,7 +151,8 @@ func serveFile(w ResponseWriter, r *Request, fsys fs.FS, name string, redirect b
}
// Use contents of index.gmi if present
index, err := fsys.Open(path.Join(name, indexPage))
name = path.Join(name, indexPage)
index, err := fsys.Open(name)
if err == nil {
defer index.Close()
istat, err := index.Stat()