From 5d813a1b58b7cca6e6a40354acd47b8fd1e0001a Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 1 Jan 2017 10:27:53 -0700 Subject: [PATCH] Close connection on automatic HTTP->HTTPS redirects --- caddyhttp/httpserver/https.go | 1 + 1 file changed, 1 insertion(+) diff --git a/caddyhttp/httpserver/https.go b/caddyhttp/httpserver/https.go index 1f5465ef..92989714 100644 --- a/caddyhttp/httpserver/https.go +++ b/caddyhttp/httpserver/https.go @@ -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 })