mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Restrict x-umami-client-* headers to cloud mode only.
This commit is contained in:
parent
fbd0564133
commit
fd2e2047cd
2 changed files with 11 additions and 7 deletions
|
|
@ -10,12 +10,16 @@ import { safeDecodeURIComponent } from '@/lib/url';
|
||||||
const MAXMIND = 'maxmind';
|
const MAXMIND = 'maxmind';
|
||||||
|
|
||||||
const PROVIDER_HEADERS = [
|
const PROVIDER_HEADERS = [
|
||||||
// Umami custom headers
|
// Umami custom headers (cloud mode only)
|
||||||
|
...(process.env.CLOUD_MODE
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
countryHeader: 'x-umami-client-country',
|
countryHeader: 'x-umami-client-country',
|
||||||
regionHeader: 'x-umami-client-region',
|
regionHeader: 'x-umami-client-region',
|
||||||
cityHeader: 'x-umami-client-city',
|
cityHeader: 'x-umami-client-city',
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
// Cloudflare headers
|
// Cloudflare headers
|
||||||
{
|
{
|
||||||
countryHeader: 'cf-ipcountry',
|
countryHeader: 'cf-ipcountry',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export const IP_ADDRESS_HEADERS = [
|
export const IP_ADDRESS_HEADERS = [
|
||||||
'x-umami-client-ip', // Umami custom header
|
...(process.env.CLOUD_MODE ? ['x-umami-client-ip'] : []), // Umami custom header (cloud mode only)
|
||||||
'true-client-ip', // CDN
|
'true-client-ip', // CDN
|
||||||
'cf-connecting-ip', // Cloudflare
|
'cf-connecting-ip', // Cloudflare
|
||||||
'fastly-client-ip', // Fastly
|
'fastly-client-ip', // Fastly
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue