From a89b02af928ed9acb4406d935c718c5825280fef Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 2 May 2023 15:22:19 +0200 Subject: [PATCH] Check domain suspensions before trying to fetch resources (#24535) --- app/services/activitypub/fetch_remote_status_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/activitypub/fetch_remote_status_service.rb b/app/services/activitypub/fetch_remote_status_service.rb index ab0acf7f0..a491b32b2 100644 --- a/app/services/activitypub/fetch_remote_status_service.rb +++ b/app/services/activitypub/fetch_remote_status_service.rb @@ -2,12 +2,15 @@ class ActivityPub::FetchRemoteStatusService < BaseService include JsonLdHelper + include DomainControlHelper include Redisable DISCOVERIES_PER_REQUEST = 1000 # Should be called when uri has already been checked for locality def call(uri, id: true, prefetched_body: nil, on_behalf_of: nil, expected_actor_uri: nil, request_id: nil) + return if domain_not_allowed?(uri) + @request_id = request_id || "#{Time.now.utc.to_i}-status-#{uri}" @json = if prefetched_body.nil? fetch_resource(uri, id, on_behalf_of)