Removed redundant http.HandlerFunc() casting (#1765)

This commit is contained in:
Vano Devium
2022-06-02 16:54:22 +03:00
committed by GitHub
parent 9d5b6faf03
commit 18d6aa2a34
2 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ func authorizationRequired(f http.HandlerFunc) http.Handler {
}
})
} else {
return http.HandlerFunc(f)
return f
}
}

View File

@@ -50,9 +50,9 @@ func createRouter(h *handler) *mux.Router {
r := mux.NewRouter()
r.Use(cspHeaders)
if base != "/" {
r.HandleFunc(base, http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
r.HandleFunc(base, func(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req, base+"/", http.StatusMovedPermanently)
}))
})
}
s := r.PathPrefix(base).Subrouter()
s.Handle("/api/logs/stream", authorizationRequired(h.streamLogs))