aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
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"