Skip to content

Commit

Permalink
local_uri is a trustworthy attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Teqed committed Sep 12, 2024
1 parent b136293 commit 8ff25f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/services/activitypub/fetch_remote_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def call(uri, prefetched_body: nil, on_behalf_of: nil, expected_actor_uri: nil,

def trustworthy_attribution?(uri, attributed_to)
return false if uri.nil? || attributed_to.nil?

return true if
ActivityPub::TagManager.instance.local_uri?(uri)
end
Addressable::URI.parse(uri).normalized_host.casecmp(Addressable::URI.parse(attributed_to).normalized_host).zero?
end

Expand Down

0 comments on commit 8ff25f7

Please sign in to comment.