flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 1fd2c6df2c950ca0614ad96ba8745b6312f43927
parent 9c90564237faf53d8ee70a963cfed465d372bdd3
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 21 Feb 2021 15:56:56 -0800

Fix index.gmi last-modified bug

Diffstat:
Mhttp.go | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/http.go b/http.go @@ -565,7 +565,7 @@ func userFile(w http.ResponseWriter, r *http.Request) { } var geminiContent string - _, err = os.Stat(path.Join(fullPath, "index.gmi")) + fullStat, err := os.Stat(path.Join(fullPath, "index.gmi")) if isDir { // redirect slash if !strings.HasSuffix(r.URL.Path, "/") { @@ -580,6 +580,9 @@ func userFile(w http.ResponseWriter, r *http.Request) { } else { fullPath = path.Join(fullPath, "index.gmi") } + if fullStat != nil { + stat = fullStat // wonky + } } if geminiContent == "" && os.IsNotExist(err) { renderDefaultError(w, http.StatusNotFound)