Skip to content

Commit

Permalink
Merge pull request umami-software#753 from nemunaire/b/cidr-comparaison
Browse files Browse the repository at this point in the history
Ensure comparaison of same CIDR IP version
  • Loading branch information
mikecao authored Aug 14, 2021
2 parents f9303e5 + 5bc72dc commit f1cb7e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f1cb7e1

Please sign in to comment.