fix: [minor] functions should take inputs with required functionality. (#4823)

master
Harshavardhana 7 years ago committed by Dee Koder
parent 69555f1224
commit 9dca0c1889
  1. 9
      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

Loading…
Cancel
Save