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

This commit is contained in:
Harshavardhana 2017-08-17 13:49:57 -07:00 committed by Dee Koder
parent 69555f1224
commit 9dca0c1889

View file

@ -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