diff --git a/src/adapters/common-adapter.ts b/src/adapters/common-adapter.ts index d32c629..bfab718 100644 --- a/src/adapters/common-adapter.ts +++ b/src/adapters/common-adapter.ts @@ -1,4 +1,4 @@ -import { Middleware, MiddlewareChain, middleware } from "../middleware" +import { Middleware, MiddlewareChain, middleware, MiddlewareProvider } from "../middleware" import { ServerResponse } from "http" // the list of all HTTP methods @@ -105,9 +105,10 @@ export function withMethods< } export function suppress( - middleware: Middleware + provider : MiddlewareProvider ): Middleware { return async (req, res, next, ...args) => { + const middleware = await provider return await middleware(req, res, () => next(), ...args) } }