mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(federation): 🐛 Make an empty allowed_ip list for bridge correctly allow any IP
This commit is contained in:
parent
b55237cdc8
commit
259fba17a7
|
|
@ -167,6 +167,10 @@ export class InboxProcessor {
|
|||
};
|
||||
}
|
||||
|
||||
if (config.federation.bridge.allowed_ips.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.requestIp) {
|
||||
return {
|
||||
message: "The request IP address could not be determined.",
|
||||
|
|
@ -174,13 +178,11 @@ export class InboxProcessor {
|
|||
};
|
||||
}
|
||||
|
||||
if (config.federation.bridge.allowed_ips.length > 0) {
|
||||
for (const ip of config.federation.bridge.allowed_ips) {
|
||||
if (matches(ip, this.requestIp.address)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
message: "The request is not from a trusted bridge IP address.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue