mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Change env variable to CLIENT_IP_HEADER.
This commit is contained in:
parent
b1ced5f32c
commit
b6ab8c381f
1 changed files with 5 additions and 6 deletions
|
|
@ -15,8 +15,12 @@ import {
|
|||
let lookup;
|
||||
|
||||
export function getIpAddress(req) {
|
||||
// Custom header
|
||||
if (req.headers[process.env.CLIENT_IP_HEADER]) {
|
||||
return req.headers[process.env.CLIENT_IP_HEADER];
|
||||
}
|
||||
// Cloudflare
|
||||
if (req.headers['cf-connecting-ip']) {
|
||||
else if (req.headers['cf-connecting-ip']) {
|
||||
return req.headers['cf-connecting-ip'];
|
||||
}
|
||||
|
||||
|
|
@ -52,11 +56,6 @@ 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