master
bel 2022-07-09 15:56:21 -06:00
parent fc7451ab40
commit 19c13c43f6
2 changed files with 1 additions and 0 deletions

Binary file not shown.

View File

@ -125,6 +125,7 @@ func writeForm(w http.ResponseWriter) {
func httpsOnly(https bool, foo http.HandlerFunc) http.HandlerFunc { func httpsOnly(https bool, foo http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
if https && r.URL.Scheme != "https" { if https && r.URL.Scheme != "https" {
log.Printf("redirecting: %+v", r.URL)
r.URL.Scheme = "https" r.URL.Scheme = "https"
http.Redirect(w, r, r.URL.String(), http.StatusSeeOther) http.Redirect(w, r, r.URL.String(), http.StatusSeeOther)
return return