From 259fba17a79fe761752080e5c21fb3330eead870 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 24 Nov 2024 16:54:24 +0100 Subject: [PATCH] fix(federation): :bug: Make an empty allowed_ip list for bridge correctly allow any IP --- classes/inbox/processor.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/inbox/processor.ts b/classes/inbox/processor.ts index f33203b4..cda1409d 100644 --- a/classes/inbox/processor.ts +++ b/classes/inbox/processor.ts @@ -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,11 +178,9 @@ 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; - } + for (const ip of config.federation.bridge.allowed_ips) { + if (matches(ip, this.requestIp.address)) { + return true; } }