diff --git a/cmd/routed/main.go b/cmd/routed/main.go index 2899bb4..8b5bde1 100644 --- a/cmd/routed/main.go +++ b/cmd/routed/main.go @@ -54,8 +54,11 @@ func main() { defer l.Close() hs := &http.Server{ - Handler: middleware.Trace(s), - Addr: scfg.WebAddr, + Handler: middleware.Trace(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + r.URL.Scheme = "https" + http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect) + })), + Addr: scfg.WebAddr, } hs.Serve(l)