From 98f1f30e727efe68bfec9220076f972e80852881 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 12 Oct 2024 09:33:52 +0100 Subject: [PATCH] fix "federation allowed" check in our code --- packages/backend/src/server/ActivityPubServerService.ts | 2 +- .../backend/src/server/api/endpoints/notes/search-by-tag.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index 8d86e63ecd..8d52cf27e6 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -173,7 +173,7 @@ export class ActivityPubServerService { return true; } - if (this.utilityService.isFederationAllowedHost(keyHost)) { + if (!this.utilityService.isFederationAllowedHost(keyHost)) { /* blocked instance: refuse (we don't care if the signature is good, if they even pretend to be from a blocked instance, they're out) */ diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index f079ab608d..2b4885a194 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -156,7 +156,7 @@ export default class extends Endpoint { // eslint- if (note.user?.isSilenced && me && followings && note.userId !== me.id && !followings[note.userId]) return false; if (note.user?.isSuspended) return false; if (note.userHost) { - if (this.utilityService.isFederationAllowedHost(note.userHost)) return false; + if (!this.utilityService.isFederationAllowedHost(note.userHost)) return false; if (this.utilityService.isSilencedHost(this.serverSettings.silencedHosts, note.userHost)) return false; } return true;