all repos — flounder @ 02f6ab33ee8df5a395fa7ee824e85a8e833b6841

A small site builder for the Gemini protocol

fix bug
alex wennerberg alex@alexwennerberg.com
Sun, 27 Dec 2020 20:59:24 -0800
commit

02f6ab33ee8df5a395fa7ee824e85a8e833b6841

parent

eb22734b0e46270fc4f4224a073142d01423997b

1 files changed, 6 insertions(+), 3 deletions(-)

jump to
M gemini.gogemini.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)