Skip to content

Commit

Permalink
Check domain suspensions before trying to fetch resources (mastodon#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and Michael Mitchell committed May 3, 2023
1 parent 89a74ec commit f5b5a71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/services/activitypub/fetch_remote_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5b5a71

Please sign in to comment.