all repos — flounder @ c0eb142b022116e58d16ed5462a4966110419a19

A small site builder for the Gemini protocol

Redirect slash for folders
alex wennerberg alex@alexwennerberg.com
Sat, 09 Jan 2021 23:21:29 -0800
commit

c0eb142b022116e58d16ed5462a4966110419a19

parent

285e08242443d7803b1beb2b522f6ca183db6ef5

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M http.gohttp.go

@@ -580,6 +580,10 @@

var geminiContent string _, err = os.Stat(path.Join(fullPath, "index.gmi")) if isDir { + // redirect slash + if !strings.HasSuffix(r.URL.Path, "/") { + http.Redirect(w, r, p+"/", http.StatusSeeOther) + } if os.IsNotExist(err) { if p == "/gemlog" { geminiContent = generateGemfeedPage(userName)