diff --git a/lib/request.js b/lib/request.js index 210921b9..78e0e351 100644 --- a/lib/request.js +++ b/lib/request.js @@ -73,7 +73,8 @@ export async function getCountry(req, ip) { const result = lookup.get(ip); - return result?.country?.iso_code; + // country can not be set, fallback to registerd_country in this case + return result?.country?.iso_code ?? result?.registered_country?.iso_code; } export async function getClientInfo(req, { screen }) {