mirror of
https://github.com/minio/minio.git
synced 2025-01-27 06:33:18 -05:00
fix: [minor] functions should take inputs with required functionality. (#4823)
This commit is contained in:
parent
69555f1224
commit
9dca0c1889
@ -24,20 +24,17 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
humanize "github.com/dustin/go-humanize"
|
humanize "github.com/dustin/go-humanize"
|
||||||
router "github.com/gorilla/mux"
|
|
||||||
"github.com/rs/cors"
|
"github.com/rs/cors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HandlerFunc - useful to chain different middleware http.Handler
|
// HandlerFunc - useful to chain different middleware http.Handler
|
||||||
type HandlerFunc func(http.Handler) http.Handler
|
type HandlerFunc func(http.Handler) http.Handler
|
||||||
|
|
||||||
func registerHandlers(mux *router.Router, handlerFns ...HandlerFunc) http.Handler {
|
func registerHandlers(h http.Handler, handlerFns ...HandlerFunc) http.Handler {
|
||||||
var f http.Handler
|
|
||||||
f = mux
|
|
||||||
for _, hFn := range handlerFns {
|
for _, hFn := range handlerFns {
|
||||||
f = hFn(f)
|
h = hFn(h)
|
||||||
}
|
}
|
||||||
return f
|
return h
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds limiting body size middleware
|
// Adds limiting body size middleware
|
||||||
|
Loading…
x
Reference in New Issue
Block a user