Skip to content
Snippets Groups Projects
Commit e4aebad3 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix handling of multiple Link headers (that should not be a thing though)

parent 2603c7e6
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ class FetchAtomService < BaseService
def process_headers(url, response)
Rails.logger.debug "Processing link header"
link_header = LinkHeader.parse(response['Link'])
link_header = LinkHeader.parse(response['Link'].is_a?(Array) ? response['Link'].first : response['Link'])
alternate_link = link_header.find_link(['rel', 'alternate'], ['type', 'application/atom+xml'])
return process_html(fetch(url)) if alternate_link.nil?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment