Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed wrong country lookup.

Mike Caoabde966647af
diff --git a/src/lib/detect.ts b/src/lib/detect.ts
index 9d9fd7db1..da2ca8a1b 100644
--- a/src/lib/detect.ts
+++ b/src/lib/detect.ts
@@ -148,7 +148,7 @@ export async function getClientInfo(request: Request, payload: Record<string, an
const userAgent = payload?.userAgent || request.headers.get('user-agent');
const ip = payload?.ip || getIpAddress(request.headers);
const location = await getLocation(ip, request.headers, !!payload?.ip);
- const country = payload?.userAgent || location?.country;
+ const country = location?.country;
const subdivision1 = location?.subdivision1;
const subdivision2 = location?.subdivision2;
const city = location?.city;