summaryrefslogtreecommitdiff
path: root/src/remote
diff options
context:
space:
mode:
Diffstat (limited to 'src/remote')
-rw-r--r--src/remote/activitypub/resolver.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/remote/activitypub/resolver.ts b/src/remote/activitypub/resolver.ts
index 32f3d9ef26..f392a65e3a 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<string>;
@@ -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();
}