all repos — flounder @ de84128d6a9cc08765098317fba37afad12177ef

A small site builder for the Gemini protocol

Fix 404 error
alex wennerberg alex@alexwennerberg.com
Sun, 27 Dec 2020 21:26:56 -0800
commit

de84128d6a9cc08765098317fba37afad12177ef

parent

5c53d0b31565f2de39eeb3753151736828b6c9c6

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M http.gohttp.go

@@ -549,8 +549,8 @@ return

} var geminiContent string + _, err := os.Stat(path.Join(fullPath, "index.gmi")) if p == "/" || isDir { - _, err := os.Stat(path.Join(fullPath, "index.gmi")) if os.IsNotExist(err) { if p == "/gemlog" { geminiContent = generateGemfeedPage(userName)

@@ -560,6 +560,10 @@ }

} else { fullPath = path.Join(fullPath, "index.gmi") } + } + if geminiContent == "" && os.IsNotExist(err) { + renderDefaultError(w, http.StatusNotFound) + return } // Dumb content negotiation _, raw := r.URL.Query()["raw"]