aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-03-20 13:33:13 -0400
committerAdnan Maolood <[email protected]>2021-03-20 13:33:15 -0400
commita40b5dcd0b5f18dc4e527c7407113b53eaf6a4d1 (patch)
tree646a58d6f119c4df31cd7cfecc4bc76db6fc0e75
parentclient: Only get cert if TrustCertificate is set (diff)
downloadgo-gemini-a40b5dcd0b5f18dc4e527c7407113b53eaf6a4d1.tar.xz
go-gemini-a40b5dcd0b5f18dc4e527c7407113b53eaf6a4d1.zip
fs: Fix empty media type for directory index pages
-rw-r--r--fs.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs.go b/fs.go
index 5e2841c..8a70df2 100644
--- a/fs.go
+++ b/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()