Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Lowercase before checking headers. Closes #2634.
Mike Caoa933f5b4a0e1
diff --git a/src/lib/detect.ts b/src/lib/detect.tsindex af5c491f1..561b91be7 100644--- a/src/lib/detect.ts+++ b/src/lib/detect.ts@@ -17,9 +17,11 @@ import { NextApiRequestCollect } from 'pages/api/send';let lookup;export function getIpAddress(req: NextApiRequestCollect) {+ const customHeader = String(process.env.CLIENT_IP_HEADER).toLowerCase();+// Custom header- if (req.headers[process.env.CLIENT_IP_HEADER]) {- return req.headers[process.env.CLIENT_IP_HEADER];+ if (customHeader !== 'undefined' && req.headers[customHeader]) {+ return req.headers[customHeader];}// Cloudflareelse if (req.headers['cf-connecting-ip']) {