From a6f1c57a14850b0be53da28cf685da1b50ed0c5e Mon Sep 17 00:00:00 2001 From: Ben <4991309+NuroDev@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:20:54 +0000 Subject: [PATCH] Add `clientAddress` when rendering --- package/src/server/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/src/server/index.ts b/package/src/server/index.ts index e549e47..3ae53c8 100644 --- a/package/src/server/index.ts +++ b/package/src/server/index.ts @@ -61,7 +61,7 @@ function handler( const app = new App(manifest); - return (req: Request) => { + return (req: Request, server: Server) => { const routeData = app.match(req); if (!routeData) { const url = new URL(req.url); @@ -87,6 +87,7 @@ function handler( return app.render(req, { addCookieHeader: true, + clientAddress: server.requestIP(req)?.address, routeData, }); };