cmd/routed: only serve sites over https
This commit is contained in:
parent
9b0c00cefd
commit
61611ba7f0
|
@ -54,8 +54,11 @@ func main() {
|
||||||
defer l.Close()
|
defer l.Close()
|
||||||
|
|
||||||
hs := &http.Server{
|
hs := &http.Server{
|
||||||
Handler: middleware.Trace(s),
|
Handler: middleware.Trace(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
Addr: scfg.WebAddr,
|
r.URL.Scheme = "https"
|
||||||
|
http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect)
|
||||||
|
})),
|
||||||
|
Addr: scfg.WebAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
hs.Serve(l)
|
hs.Serve(l)
|
||||||
|
|
Loading…
Reference in New Issue