Return status code 307 instead of 302 when redirecting from HTTP to HTTPS

This commit is contained in:
Jakob Borg 2016-01-29 11:07:51 +01:00
parent 79680b1d5e
commit fae68a5396
1 changed files with 1 additions and 1 deletions

View File

@ -424,7 +424,7 @@ func redirectToHTTPSMiddleware(h http.Handler) http.Handler {
// Redirect HTTP requests to HTTPS
r.URL.Host = r.Host
r.URL.Scheme = "https"
http.Redirect(w, r, r.URL.String(), http.StatusFound)
http.Redirect(w, r, r.URL.String(), http.StatusTemporaryRedirect)
} else {
h.ServeHTTP(w, r)
}