mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Merge pull request #1775 from EffakT/country_fallback
Adding registered_country fallback to getCountry
This commit is contained in:
commit
7a3443cd06
1 changed files with 2 additions and 1 deletions
|
|
@ -73,7 +73,8 @@ export async function getCountry(req, ip) {
|
||||||
|
|
||||||
const result = lookup.get(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 }) {
|
export async function getClientInfo(req, { screen }) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue