remove redundant handlerutil.Redirect

This commit is contained in:
sentriz
2024-04-28 13:31:59 +01:00
parent 6ba342c770
commit 559c9106b0
2 changed files with 1 additions and 7 deletions

View File

@@ -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())

View File

@@ -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)