fix: can't use JapeMiddlewareFunc in type switch to cast

This commit is contained in:
Derrick Hammer 2024-01-22 17:06:39 -05:00
parent 2020a9f1d1
commit 35cd041978
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

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