mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Added COUNTRY_IP_HEADER environment variable. Closes #814.
This commit is contained in:
parent
0a8c06b1f8
commit
b1ced5f32c
2 changed files with 8 additions and 1 deletions
|
|
@ -52,6 +52,11 @@ export function getDevice(screen, browser, os) {
|
|||
}
|
||||
|
||||
export async function getCountry(req, ip) {
|
||||
// Custom header
|
||||
if (req.headers[process.env.COUNTRY_IP_HEADER]) {
|
||||
return req.headers[process.env.COUNTRY_IP_HEADER];
|
||||
}
|
||||
|
||||
// Cloudflare
|
||||
if (req.headers['cf-ipcountry']) {
|
||||
return req.headers['cf-ipcountry'];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue