log
parent
fc7451ab40
commit
19c13c43f6
BIN
exec-simpleserve
BIN
exec-simpleserve
Binary file not shown.
1
main.go
1
main.go
|
|
@ -125,6 +125,7 @@ func writeForm(w http.ResponseWriter) {
|
|||
func httpsOnly(https bool, foo http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if https && r.URL.Scheme != "https" {
|
||||
log.Printf("redirecting: %+v", r.URL)
|
||||
r.URL.Scheme = "https"
|
||||
http.Redirect(w, r, r.URL.String(), http.StatusSeeOther)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue