internal/frontend: use full URL in redirect
Fixes golang/go#50900
Trust: Jamal Carvalho
Run-TryBot: Jamal Carvalho
TryBot-Result: kokoro
@@ -36,7 +36,9 @@ func (s *Server) serveDetails(w http.ResponseWriter, r *http.Request, ds interna
return nil
}
if strings.HasSuffix(r.URL.Path, "/") {
- http.Redirect(w, r, strings.TrimSuffix(r.URL.Path, "/"), http.StatusMovedPermanently)
+ url := *r.URL
+ url.Path = strings.TrimSuffix(r.URL.Path, "/")
+ http.Redirect(w, r, url.String(), http.StatusMovedPermanently)
return
}
