From 3c3d7488e88036699a1111a4f2253772bb3abe31 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Tue, 12 Jul 2022 08:31:04 -0400 Subject: [PATCH] feat: get client IP from Context object rather than header --- plugin/src/templates/edge/runtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/templates/edge/runtime.ts b/plugin/src/templates/edge/runtime.ts index d380e66f54..def301d78a 100644 --- a/plugin/src/templates/edge/runtime.ts +++ b/plugin/src/templates/edge/runtime.ts @@ -47,7 +47,7 @@ const handler = async (req: Request, context: Context) => { }, url: url.toString(), method: req.method, - ip: req.headers.get('x-nf-client-address') ?? undefined, + ip: context.ip, body: req.body ?? undefined, }