Author: Adam Evyčędo <git@apiote.xyz>
remove donate workaround
router.go | 11 +----------
diff --git a/router.go b/router.go index 8598d7188df2df0ef265a7705b67572e5dc2ce73..b4b7c59ad0fed97e523fa9d9d3e234a7d6106dc0 100644 --- a/router.go +++ b/router.go @@ -147,15 +147,7 @@ } } func donate(w http.ResponseWriter, r *http.Request) { - path := strings.Split(r.URL.Path[1:], "/") - if len(path) == 1 { - showHtml(w, "donate", nil) - } else if path[1] == "" { - w.Header().Add("Location", "/donate") - w.WriteHeader(301) - } else if path[1] != "" { - renderStatus(w, 404) - } + showHtml(w, "donate", nil) } func readPrograms() (map[string]Program, error) { @@ -563,7 +555,6 @@ http.HandleFunc("/blog/", blogEntries) http.HandleFunc("/p/", programs) http.HandleFunc("/programs/", programs) http.HandleFunc("/donate", donate) - http.HandleFunc("/donate/", donate) // xxx historical reasons for trailing slash http.HandleFunc("/pgp/", pgp) http.HandleFunc("/calendar", calendar)