chore: remove CF-region (#13828)

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
This commit is contained in:
Udit Takkar
2024-03-05 02:42:56 +05:30
committed by GitHub
co-authored by Joe Au-Yeung
parent 1f845944ac
commit e39bf37f91
@@ -7,8 +7,7 @@ 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?.["x-vercel-ip-country"] ?? "";
return { countryCode: Array.isArray(countryCode) ? countryCode[0] : countryCode };
};