fix: add HttpMiddlewareFunc to switch case

This commit is contained in:
Derrick Hammer 2024-02-17 05:28:56 -05:00
parent d4be04eae9
commit 9949dae5e8
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ func ApplyMiddlewares(handler jape.Handler, middlewares ...interface{}) jape.Han
case JapeMiddlewareFunc: case JapeMiddlewareFunc:
mid := middlewares[i].(JapeMiddlewareFunc) mid := middlewares[i].(JapeMiddlewareFunc)
handler = mid(handler) handler = mid(handler)
case func(http.Handler) http.Handler: case func(http.Handler) http.Handler, HttpMiddlewareFunc:
mid := middlewares[i].(func(http.Handler) http.Handler) mid := middlewares[i].(func(http.Handler) http.Handler)
handler = AdaptMiddleware(mid)(handler) handler = AdaptMiddleware(mid)(handler)