fix: country code [Testing] (#12807)
* fix: country code * chore * chore: only test cloudflare --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
1 parent
5fb1857538
commit
b6279f4128
1 file changed
+3
-1
@@ -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 };
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user