Scheduling infrastructure for absolutely everyone.
chore: added a fallback for country code (#13171)
Udit Takkarb1bf94aa58fa
diff --git a/packages/trpc/server/routers/publicViewer/countryCode.handler.ts b/packages/trpc/server/routers/publicViewer/countryCode.handler.tsindex 181a10a1cb5..723632e0888 100644--- a/packages/trpc/server/routers/publicViewer/countryCode.handler.ts+++ b/packages/trpc/server/routers/publicViewer/countryCode.handler.ts@@ -7,9 +7,8 @@ type CountryCodeOptions = {export const countryCodeHandler = async ({ ctx }: CountryCodeOptions) => {const { req } = ctx;- // const countryCode: string | string[] =- // req?.headers?.["cf-ipcountry"] ?? req?.headers?.["x-vercel-ip-country"] ?? "";- const countryCode: string | string[] = req?.headers?.["cf-ipcountry"] ?? "";+ const countryCode: string | string[] =+ req?.headers?.["cf-ipcountry"] ?? req?.headers?.["x-vercel-ip-country"] ?? "";return { countryCode: Array.isArray(countryCode) ? countryCode[0] : countryCode };};