1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-11-26 10:23:45 +01:00

fs: Fix empty media type for directory index pages

This commit is contained in:
adnano 2021-03-20 13:33:13 -04:00
parent dfe8446d49
commit 21845ca419

3
fs.go

@ -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()