log
This commit is contained in:
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 {
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user