Restrict x-umami-client-* headers to cloud mode only.
This commit is contained in:
+10
-6
@@ -10,12 +10,16 @@ import { safeDecodeURIComponent } from '@/lib/url';
|
||||
const MAXMIND = 'maxmind';
|
||||
|
||||
const PROVIDER_HEADERS = [
|
||||
// Umami custom headers
|
||||
{
|
||||
countryHeader: 'x-umami-client-country',
|
||||
regionHeader: 'x-umami-client-region',
|
||||
cityHeader: 'x-umami-client-city',
|
||||
},
|
||||
// Umami custom headers (cloud mode only)
|
||||
...(process.env.CLOUD_MODE
|
||||
? [
|
||||
{
|
||||
countryHeader: 'x-umami-client-country',
|
||||
regionHeader: 'x-umami-client-region',
|
||||
cityHeader: 'x-umami-client-city',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
// Cloudflare headers
|
||||
{
|
||||
countryHeader: 'cf-ipcountry',
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
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
|
||||
'cf-connecting-ip', // Cloudflare
|
||||
'fastly-client-ip', // Fastly
|
||||
|
||||
Reference in New Issue
Block a user