diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 94b8a6503..178ea12ea 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -45,12 +45,18 @@ export class Resolver { } } - public async resolve(value: string | IObject, allowRedirect = false): Promise { + public async resolve(value?: string | IObject | null, allowRedirect = false): Promise { if (value == null) { throw new Error('resolvee is null (or undefined)'); } if (typeof value !== 'string') { + if (typeof value.id !== 'undefined') { + const host = extractDbHost(getApId(value)); + if (await shouldBlockInstance(host)) { + throw new Error('instance is blocked'); + } + } return value; } @@ -75,7 +81,7 @@ export class Resolver { } if (await shouldBlockInstance(host)) { - throw new Error('Instance is blocked'); + throw new Error('instance is blocked'); } if (!this.user) {