0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Close connection on automatic HTTP->HTTPS redirects

This commit is contained in:
Matthew Holt 2017-01-01 10:27:53 -07:00
parent 466efb7e67
commit 5d813a1b58
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -149,6 +149,7 @@ func redirPlaintextHost(cfg *SiteConfig) *SiteConfig {
toURL += ":" + redirPort
}
toURL += r.URL.RequestURI()
w.Header().Set("Connection", "close")
http.Redirect(w, r, toURL, http.StatusMovedPermanently)
return 0, nil
})