diff --git a/cmd/gonic/gonic.go b/cmd/gonic/gonic.go index 625c348..4548904 100644 --- a/cmd/gonic/gonic.go +++ b/cmd/gonic/gonic.go @@ -273,7 +273,7 @@ func main() { mux.Handle("/admin/", http.StripPrefix("/admin", chain(ctrlAdmin))) mux.Handle("/rest/", http.StripPrefix("/rest", chain(trim(ctrlSubsonic)))) mux.Handle("/ping", chain(handlerutil.Message("ok"))) - mux.Handle("/", chain(handlerutil.Redirect(resolveProxyPath("/admin/home")))) + mux.Handle("/", chain(http.RedirectHandler(resolveProxyPath("/admin/home"), http.StatusSeeOther))) if *confExpvar { mux.Handle("/debug/vars", expvar.Handler()) diff --git a/handlerutil/handlerutil.go b/handlerutil/handlerutil.go index 4116dc7..8fd27ae 100644 --- a/handlerutil/handlerutil.go +++ b/handlerutil/handlerutil.go @@ -56,12 +56,6 @@ func BasicCORS(next http.Handler) http.Handler { }) } -func Redirect(to string) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, to, http.StatusSeeOther) - }) -} - func Message(message string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, message)