Remove redundant http.HandlerFunc type conversion. (#10576)

This commit is contained in:
飞雪无情
2020-09-29 04:33:49 +08:00
committed by GitHub
parent e0c04a2da0
commit 209680e89f
2 changed files with 4 additions and 4 deletions

View File

@@ -218,6 +218,6 @@ func registerAdminRouter(router *mux.Router, enableConfigOps, enableIAMOps bool)
}
// If none of the routes match add default error handler routes
adminRouter.NotFoundHandler = http.HandlerFunc(httpTraceAll(errorResponseHandler))
adminRouter.MethodNotAllowedHandler = http.HandlerFunc(httpTraceAll(errorResponseHandler))
adminRouter.NotFoundHandler = httpTraceAll(errorResponseHandler)
adminRouter.MethodNotAllowedHandler = httpTraceAll(errorResponseHandler)
}

View File

@@ -332,8 +332,8 @@ func registerAPIRouter(router *mux.Router) {
maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler))))
// If none of the routes match add default error handler routes
apiRouter.NotFoundHandler = http.HandlerFunc(collectAPIStats("notfound", httpTraceAll(errorResponseHandler)))
apiRouter.MethodNotAllowedHandler = http.HandlerFunc(collectAPIStats("methodnotallowed", httpTraceAll(errorResponseHandler)))
apiRouter.NotFoundHandler = collectAPIStats("notfound", httpTraceAll(errorResponseHandler))
apiRouter.MethodNotAllowedHandler = collectAPIStats("methodnotallowed", httpTraceAll(errorResponseHandler))
}