mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
fix: handle unknown location fields in user detection
This commit is contained in:
parent
ebdd9095ab
commit
0736289ce1
1 changed files with 3 additions and 3 deletions
|
|
@ -146,9 +146,9 @@ 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 = decodeURIComponent(location?.country);
|
||||
const region = decodeURIComponent(location?.region);
|
||||
const city = decodeURIComponent(location?.city);
|
||||
const country = decodeURIComponent(location?.country || 'UNKNOWN');
|
||||
const region = decodeURIComponent(location?.region || 'UNKNOWN');
|
||||
const city = decodeURIComponent(location?.city || 'UNKNOWN');
|
||||
const browser = browserName(userAgent);
|
||||
const os = detectOS(userAgent) as string;
|
||||
const device = getDevice(payload?.screen, os);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue