This commit is contained in:
Owen 2025-02-09 22:00:02 -05:00
parent 5e92aebd20
commit bbc1a9eac4
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD

View file

@ -491,13 +491,13 @@ async function checkRules(
for (const rule of rules) { for (const rule of rules) {
if ( if (
(clientIp && (clientIp &&
rule.match == "CIDR" && rule.match == "CIDR" &&
isIpInCidr(clientIp, rule.value) && isIpInCidr(clientIp, rule.value) &&
rule.action === "DROP") || rule.action === "DROP") ||
(path && (path &&
rule.match == "PATH" && rule.match == "PATH" &&
urlGlobToRegex(rule.value).test(path) && urlGlobToRegex(rule.value).test(path) &&
rule.action === "DROP") rule.action === "DROP")
) { ) {
return "DROP"; return "DROP";
} }
@ -514,11 +514,11 @@ async function checkRules(
if ( if (
(clientIp && (clientIp &&
rule.match == "CIDR" && rule.match == "CIDR" &&
isIpInCidr(clientIp, rule.value)) || isIpInCidr(clientIp, rule.value)) ||
(path && (path &&
rule.match == "PATH" && rule.match == "PATH" &&
urlGlobToRegex(rule.value).test(path)) urlGlobToRegex(rule.value).test(path))
) { ) {
return "ACCEPT"; return "ACCEPT";
} }