Skip to content

Commit 24f997b

Browse files
committed
fix request ID header
1 parent aaf959e commit 24f997b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ async function init(prettyPrint: boolean = false) {
311311
origin: app.environmentConfig.ValidCorsOrigins,
312312
methods: ["GET", "HEAD", "POST", "PATCH", "DELETE"],
313313
});
314+
app.addHook("onSend", async (request, reply) => {
315+
reply.header("X-Request-Id", request.id);
316+
});
314317
app.log.info("Initialized new Fastify instance...");
315318
return app;
316319
}

0 commit comments

Comments
 (0)