fix: HttpMiddlewareFunc needs its own case
This commit is contained in:
parent
9949dae5e8
commit
3ded11d705
|
@ -51,9 +51,12 @@ 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, HttpMiddlewareFunc:
|
case func(http.Handler) http.Handler:
|
||||||
mid := middlewares[i].(func(http.Handler) http.Handler)
|
mid := middlewares[i].(func(http.Handler) http.Handler)
|
||||||
handler = AdaptMiddleware(mid)(handler)
|
handler = AdaptMiddleware(mid)(handler)
|
||||||
|
case HttpMiddlewareFunc:
|
||||||
|
mid := middlewares[i].(HttpMiddlewareFunc)
|
||||||
|
handler = AdaptMiddleware(mid)(handler)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
panic("Invalid middleware type")
|
panic("Invalid middleware type")
|
||||||
|
|
Loading…
Reference in New Issue