Removed redundant http.HandlerFunc() casting (#1765)
This commit is contained in:
@@ -35,7 +35,7 @@ func authorizationRequired(f http.HandlerFunc) http.Handler {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return http.HandlerFunc(f)
|
||||
return f
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user