0
0
Fork 0

Select correct self link when parsing Webfinger response (#31110)

This commit is contained in:
Adam Niedzielski 2024-07-23 16:42:31 +02:00 committed by GitHub
parent a8330be93e
commit cd0ca4b994
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 73 additions and 26 deletions

View file

@ -106,8 +106,6 @@ class ResolveAccountService < BaseService
end
def fetch_account!
return unless activitypub_ready?
with_redis_lock("resolve:#{@username}@#{@domain}") do
@account = ActivityPub::FetchRemoteAccountService.new.call(actor_url, suppress_errors: @options[:suppress_errors])
end
@ -122,12 +120,8 @@ class ResolveAccountService < BaseService
@options[:skip_cache] || @account.nil? || @account.possibly_stale?
end
def activitypub_ready?
['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(@webfinger.link('self', 'type'))
end
def actor_url
@actor_url ||= @webfinger.link('self', 'href')
@actor_url ||= @webfinger.self_link_href
end
def gone_from_origin?