@ -50,7 +50,7 @@ class FetchAtomService < BaseService
@unsupported_activity = true
nil
end
elsif @response [ 'Link' ] && ! terminal
elsif @response [ 'Link' ] && ! terminal && link_header . find_link ( %w( rel alternate ) )
process_headers
elsif @response . mime_type == 'text/html' && ! terminal
process_html
@ -70,8 +70,6 @@ class FetchAtomService < BaseService
end
def process_headers
link_header = LinkHeader . parse ( @response [ 'Link' ] . is_a? ( Array ) ? @response [ 'Link' ] . first : @response [ 'Link' ] )
json_link = link_header . find_link ( %w( rel alternate ) , %w( type application/activity+json ) ) || link_header . find_link ( %w( rel alternate ) , [ 'type' , 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ] )
atom_link = link_header . find_link ( %w( rel alternate ) , %w( type application/atom+xml ) )
@ -80,4 +78,8 @@ class FetchAtomService < BaseService
result
end
def link_header
@link_header || = LinkHeader . parse ( @response [ 'Link' ] . is_a? ( Array ) ? @response [ 'Link' ] . first : @response [ 'Link' ] )
end
end