From 00738b90c2e02d648422ac495859e169562af25c Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 26 Feb 2024 21:31:43 +0000 Subject: [PATCH] :v: --- .../src/core/activitypub/ApDbResolverService.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/activitypub/ApDbResolverService.ts b/packages/backend/src/core/activitypub/ApDbResolverService.ts index fe211157b9..0cb3b78941 100644 --- a/packages/backend/src/core/activitypub/ApDbResolverService.ts +++ b/packages/backend/src/core/activitypub/ApDbResolverService.ts @@ -171,10 +171,12 @@ export class ApDbResolverService implements OnApplicationShutdown { keys.find(x => { try { const url = new URL(x.keyId); - if ( - url.hash.toLowerCase().includes('main') || - url.pathname.split('/').pop()?.toLowerCase().includes('main') - ) { + const path = url.pathname.split('/').pop()?.toLowerCase(); + if (url.hash) { + if (url.hash.toLowerCase().includes('main')) { + return true; + } + } else if (path?.includes('main') || path === 'publickey') { return true; } } catch { /* noop */ }