mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Merge pull request #3809 from RaenonX/master
Allow `browser` / `os` / `device` override in `payload` & return `cache` from `/api/batch`
This commit is contained in:
commit
23ff20a10b
3 changed files with 12 additions and 4 deletions
|
|
@ -114,9 +114,9 @@ export async function getClientInfo(request: Request, payload: Record<string, an
|
|||
const country = safeDecodeURIComponent(location?.country);
|
||||
const region = safeDecodeURIComponent(location?.region);
|
||||
const city = safeDecodeURIComponent(location?.city);
|
||||
const browser = browserName(userAgent);
|
||||
const os = detectOS(userAgent) as string;
|
||||
const device = getDevice(userAgent, payload?.screen);
|
||||
const browser = payload?.browser ?? browserName(userAgent);
|
||||
const os = payload?.os ?? (detectOS(userAgent) as string);
|
||||
const device = payload?.device ?? getDevice(userAgent, payload?.screen);
|
||||
|
||||
return { userAgent, browser, os, ip, country, region, city, device };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue