From c11e3df0cca9239c07d2738038065860e8d942a0 Mon Sep 17 00:00:00 2001 From: clsr Date: Sat, 18 Jun 2016 17:57:14 +0200 Subject: Do not redirect to HTTPS with when the Host header is blank --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 2dcac62..6e4b0f6 100644 --- a/main.go +++ b/main.go @@ -31,7 +31,7 @@ func handle(w http.ResponseWriter, r *http.Request) { if hsts { w.Header().Set("Strict-Transport-Security", "max-age=15552000") } - if redirectHttps && r.TLS == nil { + if redirectHttps && r.TLS == nil && r.Host != "" { targ := &*r.URL targ.Host = r.Host targ.Scheme = "https" -- cgit