From 9dca0c1889df6588f47d9540bebb016f20e675f8 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 17 Aug 2017 13:49:57 -0700 Subject: [PATCH] fix: [minor] functions should take inputs with required functionality. (#4823) --- cmd/generic-handlers.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index a233df2a0..4306c8ed3 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -24,20 +24,17 @@ import ( "time" humanize "github.com/dustin/go-humanize" - router "github.com/gorilla/mux" "github.com/rs/cors" ) // HandlerFunc - useful to chain different middleware http.Handler type HandlerFunc func(http.Handler) http.Handler -func registerHandlers(mux *router.Router, handlerFns ...HandlerFunc) http.Handler { - var f http.Handler - f = mux +func registerHandlers(h http.Handler, handlerFns ...HandlerFunc) http.Handler { for _, hFn := range handlerFns { - f = hFn(f) + h = hFn(h) } - return f + return h } // Adds limiting body size middleware