Skip to content

armgit / umami

Public Imported from GitHub
0

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.

Ensure comparaison of same CIDR IP version

Pierre-Olivier Mercier5bc72dcb99b3
diff --git a/pages/api/collect.js b/pages/api/collect.js
index f7ce44b6e..41c9cabb7 100644
--- a/pages/api/collect.js
+++ b/pages/api/collect.js
@@ -24,7 +24,7 @@ export default async (req, res) => {
const addr = ipaddr.parse(ip);
const range = ipaddr.parseCIDR(i);
- if (addr.match(range)) return true;
+ if (addr.kind() === range[0].kind() && addr.match(range)) return true;
}
return false;