feat: add middleware destination (#1123)

Closes #521
This commit is contained in:
Leo Kettmeir
2023-04-20 13:14:12 +02:00
committed by GitHub
parent f3f6f227c4
commit 9dd026e0f5
5 changed files with 159 additions and 64 deletions
+10
View File
@@ -50,8 +50,18 @@ async function rootHandler(
return resp;
}
async function kindHandler(
_req: Request,
ctx: MiddlewareHandlerContext,
) {
const resp = await ctx.next();
resp.headers.set("destination", ctx.destination);
return resp;
}
export const handler: MiddlewareHandler | MiddlewareHandler[] = [
rootHandler,
logHandler,
kindHandler,
corsHandler,
];