Skip to content

Commit

Permalink
fix: correct middleware apply order
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Feb 19, 2022
1 parent 24ce4e7 commit 26882a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (p *Plugin) tlsAddr(host string, forcePort bool) string {
}

func applyMiddlewares(server *http.Server, middlewares map[string]middleware.Middleware, order []string, log *zap.Logger) {
for i := len(order) - 1; i >= 0; i-- {
for i := 0; i < len(order); i++ {
if mdwr, ok := middlewares[order[i]]; ok {
server.Handler = mdwr.Middleware(server.Handler)
} else {
Expand Down

0 comments on commit 26882a1

Please sign in to comment.