middleware stacking bug fix
This commit is contained in:
2
stack.go
2
stack.go
@@ -3,7 +3,7 @@ package mux
|
||||
import "net/http"
|
||||
|
||||
// stack middlewares(http handler) in order they are passed (FIFO)
|
||||
func stack(middlewares []func(http.Handler) http.Handler, endpoint http.Handler) http.Handler {
|
||||
func stack(endpoint http.Handler, middlewares []func(http.Handler) http.Handler) http.Handler {
|
||||
// Return ahead of time if there aren't any middlewares for the chain
|
||||
if len(middlewares) == 0 {
|
||||
return endpoint
|
||||
|
Reference in New Issue
Block a user