From 4bd617af64b1ca603283ce2c1e531965f71b7150 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 23 May 2023 21:18:25 +0100 Subject: [PATCH] feat: pass x-forwarded-for to indexer --- src/app/layout.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6984bf17..adb232ea 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -82,9 +82,14 @@ export default function RootLayout({ const colorScheme = getColorScheme() // For viewing statistics - updateIndexerFetchOptions({ - headers: headers(), - }) + const ip = headers().get("x-xlog-ip") + if (ip) { + updateIndexerFetchOptions({ + headers: { + "x-forwarded-for": ip || "", + }, + }) + } return (