Seperate ip and cidr

This commit is contained in:
Owen 2025-02-10 21:06:37 -05:00
parent 5b44ffa2fb
commit 3c99fbb1ef
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
6 changed files with 51 additions and 13 deletions

View file

@ -494,6 +494,10 @@ async function checkRules(
rule.match == "CIDR" &&
isIpInCidr(clientIp, rule.value) &&
rule.action === "DROP") ||
(clientIp &&
rule.match == "IP" &&
clientIp == rule.value &&
rule.action === "DROP") ||
(path &&
rule.match == "PATH" &&
urlGlobToRegex(rule.value).test(path) &&
@ -516,6 +520,9 @@ async function checkRules(
(clientIp &&
rule.match == "CIDR" &&
isIpInCidr(clientIp, rule.value)) ||
(clientIp &&
rule.match == "IP" &&
clientIp == rule.value) ||
(path &&
rule.match == "PATH" &&
urlGlobToRegex(rule.value).test(path))