bouncer/internal/proxy/director/util.go

19 lines
326 B
Go
Raw Permalink Normal View History

2023-04-24 20:52:12 +02:00
package director
import (
"net/http"
"forge.cadoles.com/Cadoles/go-proxy"
"forge.cadoles.com/Cadoles/go-proxy/util"
)
func createMiddlewareChain(handler http.Handler, middlewares []proxy.Middleware) http.Handler {
util.Reverse(middlewares)
for _, m := range middlewares {
handler = m(handler)
}
return handler
}