From 5bc72dcb99b38bdf3c1b31d79ce4566a8ef3a2cb Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 11 Aug 2021 14:31:32 +0200 Subject: [PATCH] Ensure comparaison of same CIDR IP version --- pages/api/collect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/collect.js b/pages/api/collect.js index f7ce44b6..41c9cabb 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;