fix bug
alex wennerberg alex@alexwennerberg.com
Sun, 27 Dec 2020 20:59:24 -0800
1 files changed,
6 insertions(+),
3 deletions(-)
jump to
M
gemini.go
→
gemini.go
@@ -89,9 +89,12 @@ }
log.Println("Request for gemini file", fileName, "for user", userName) if fileName == "/gemlog" { // temp hack - w.SetMediaType("text/gemini") - io.Copy(w, strings.NewReader(generateGemfeedPage(userName))) - return + _, err := os.Stat(path.Join(c.FilesDirectory, userName, fileName, "index.gmi")) + if err != nil { + w.SetMediaType("text/gemini") + io.Copy(w, strings.NewReader(generateGemfeedPage(userName))) + return + } } gmi.ServeFile(w, gmi.Dir(path.Join(c.FilesDirectory, userName)), fileName)