mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-08 21:14:32 +00:00
enforce port restrictions against requests that happen to be missing the port
This commit is contained in:
parent
4ddb16aa9a
commit
ebd4ccdd55
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ export function isPrivateIp(allowedPrivateNetworks: PrivateNetwork[] | undefined
|
||||||
|
|
||||||
for (const { cidr, ports } of allowedPrivateNetworks ?? []) {
|
for (const { cidr, ports } of allowedPrivateNetworks ?? []) {
|
||||||
if (cidr[0].kind() === parsedIp.kind() && parsedIp.match(cidr)) {
|
if (cidr[0].kind() === parsedIp.kind() && parsedIp.match(cidr)) {
|
||||||
if (port == null || ports == null || ports.includes(port)) {
|
if (ports == null || (port != null && ports.includes(port))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue