diff --git a/src/remote/activitypub/resolver.ts b/src/remote/activitypub/resolver.ts index 32f3d9ef2..f392a65e3 100644 --- a/src/remote/activitypub/resolver.ts +++ b/src/remote/activitypub/resolver.ts @@ -4,6 +4,8 @@ import { ILocalUser } from '@/models/entities/user'; import { getInstanceActor } from '@/services/instance-actor'; import { signedGet } from './request'; import { IObject, isCollectionOrOrderedCollection, ICollection, IOrderedCollection } from './type'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { extractDbHost } from '@/misc/convert-host'; export default class Resolver { private history: Set; @@ -44,6 +46,12 @@ export default class Resolver { this.history.add(value); + const meta = await fetchMeta(); + const host = extractDbHost(value); + if (meta.blockedHosts.includes(host)) { + throw new Error('Instance is blocked'); + } + if (config.signToActivityPubGet && !this.user) { this.user = await getInstanceActor(); }