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