chore: added a fallback for country code (#13171)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
co-authored by
Peer Richelsen
parent
0a921c2929
commit
b1bf94aa58
@@ -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 };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user