From b6279f4128d8e44aefe9d899c14b40ace563c9d1 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:31:08 +0530 Subject: [PATCH] fix: country code [Testing] (#12807) * fix: country code * chore * chore: only test cloudflare --------- Co-authored-by: Alex van Andel --- .../trpc/server/routers/publicViewer/countryCode.handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/trpc/server/routers/publicViewer/countryCode.handler.ts b/packages/trpc/server/routers/publicViewer/countryCode.handler.ts index ed67a3d959..181a10a1cb 100644 --- a/packages/trpc/server/routers/publicViewer/countryCode.handler.ts +++ b/packages/trpc/server/routers/publicViewer/countryCode.handler.ts @@ -7,7 +7,9 @@ type CountryCodeOptions = { export const countryCodeHandler = async ({ ctx }: CountryCodeOptions) => { const { req } = ctx; - const countryCode: string | string[] = req?.headers?.["x-vercel-ip-country"] ?? ""; + // const countryCode: string | string[] = + // req?.headers?.["​cf-ipcountry"] ?? req?.headers?.["x-vercel-ip-country"] ?? ""; + const countryCode: string | string[] = req?.headers?.["​cf-ipcountry"] ?? ""; return { countryCode: Array.isArray(countryCode) ? countryCode[0] : countryCode }; };