cmd/routed: redirect better
This commit is contained in:
parent
61611ba7f0
commit
4396e6822e
|
@ -55,6 +55,7 @@ func main() {
|
||||||
|
|
||||||
hs := &http.Server{
|
hs := &http.Server{
|
||||||
Handler: middleware.Trace(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
Handler: middleware.Trace(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
r.URL.Host = r.Host
|
||||||
r.URL.Scheme = "https"
|
r.URL.Scheme = "https"
|
||||||
http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect)
|
http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect)
|
||||||
})),
|
})),
|
||||||
|
|
Loading…
Reference in New Issue