cmd/routed: log http redirects

This commit is contained in:
Cadey Ratio 2017-10-01 11:04:19 -07:00
parent 4396e6822e
commit 26a32350c9
No known key found for this signature in database
GPG Key ID: D607EE27C2E7F89A
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ func main() {
Handler: middleware.Trace(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
r.URL.Host = r.Host
r.URL.Scheme = "https"
ln.Log(r.Context(), ln.Action("redirecting insecure HTTP to HTTPS"))
http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect)
})),
Addr: scfg.WebAddr,