diff options
| author | thinkpadmaster <a.scerba02@gmail.com> | 2023-07-21 22:59:30 -0500 |
|---|---|---|
| committer | Alex Scerba <alex@scerba.org> | 2024-10-29 13:19:57 -0400 |
| commit | 7ebcab98575c8aec5a0dda9170f9b67346678976 (patch) | |
| tree | ea8f7c8783636cbe30194b672b3b624b4355dc44 | |
| parent | 2d82e28f17fcc613f15fcc7b1436cb923f2ac911 (diff) | |
Switch from builtin r.URL.Scheme to hardcoding
| -rw-r--r-- | main.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -27,7 +27,7 @@ func (app *application) httpsRedirect(w http.ResponseWriter, req *http.Request) func (app *application) wwwRedirect(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if !strings.HasPrefix(r.Host, "www.") { - http.Redirect(w, r, r.URL.Scheme+"://www."+r.Host+r.RequestURI, 302) + http.Redirect(w, r, "https://www."+r.Host+r.RequestURI, 302) return } |
