diff options
author | clsr <clsr@clsr.net> | 2016-06-18 17:57:14 +0200 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2016-06-18 17:57:14 +0200 |
commit | c11e3df0cca9239c07d2738038065860e8d942a0 (patch) | |
tree | 336dfe559714f437039f82c8beee1ea6064b1fe2 | |
parent | a58ca2fe51afe945b241bcab4fb21b0d4a9fcbe4 (diff) | |
download | gomf-c11e3df0cca9239c07d2738038065860e8d942a0.tar.gz gomf-c11e3df0cca9239c07d2738038065860e8d942a0.zip |
Do not redirect to HTTPS with when the Host header is blank
-rw-r--r-- | main.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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" |