From 63b179c17808a126e301480c1f5d8382741e1890 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 6e266d9bc..6c10c02ea 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[]), ), );