mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Fixed Vercel geolocation.
This commit is contained in:
parent
02f031bde1
commit
c49e2c6974
@ -62,11 +62,11 @@ export async function getLocation(ip, req) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.VERCEL) {
|
if (req.headers['x-vercel-ip-country']) {
|
||||||
return {
|
return {
|
||||||
country: req.headers['x-vercel-ip-city'],
|
country: req.headers['x-vercel-ip-country'],
|
||||||
subdivision1: req.headers['x-vercel-ip-country-region'],
|
subdivision1: `${req.headers['x-vercel-ip-country']}-${req.headers['x-vercel-ip-country-region']}`,
|
||||||
city: req.headers['x-vercel-ip-country'],
|
city: req.headers['x-vercel-ip-city'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user