Select correct self link when parsing Webfinger response (#31110)
This commit is contained in:
parent
a8330be93e
commit
cd0ca4b994
10 changed files with 73 additions and 26 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue