From 209680e89f52511e43937c149e5dea3e787879a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=9E=E9=9B=AA=E6=97=A0=E6=83=85?= Date: Tue, 29 Sep 2020 04:33:49 +0800 Subject: [PATCH] Remove redundant http.HandlerFunc type conversion. (#10576) --- cmd/admin-router.go | 4 ++-- cmd/api-router.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/admin-router.go b/cmd/admin-router.go index c5a74dfdf..f6b578acf 100644 --- a/cmd/admin-router.go +++ b/cmd/admin-router.go @@ -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) } diff --git a/cmd/api-router.go b/cmd/api-router.go index 9f329f40a..3bdd166e4 100644 --- a/cmd/api-router.go +++ b/cmd/api-router.go @@ -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)) }