From df9d15490f6f96ba554854f2a6c2a3552b7775a5 Mon Sep 17 00:00:00 2001 From: Natty Date: Wed, 16 Aug 2023 01:21:28 +0200 Subject: [PATCH] Also check instances to skip --- .../backend/src/remote/activitypub/deliver-manager.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/deliver-manager.ts b/packages/backend/src/remote/activitypub/deliver-manager.ts index 6e266d9bcc..6c10c02ea6 100644 --- a/packages/backend/src/remote/activitypub/deliver-manager.ts +++ b/packages/backend/src/remote/activitypub/deliver-manager.ts @@ -126,7 +126,14 @@ export default class DeliverManager { const instancesToSkip = await skippedInstances( // get (unique) list of hosts Array.from( - new Set(Array.from(inboxes).map((inbox) => new URL(inbox).host)), + new Set(Array.from(inboxes).map((inbox) => { + try { + return new URL(inbox).host; + } catch (e) { + apLogger.error(`Invalid inbox URL: ${inbox}`); + return null; + } + } ).filter((host) => host != null) as string[]), ), );