about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-27 23:49:12 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-27 23:49:12 +0200
commite4aebad35afae12f4b7503fb6c3783fcd3809761 (patch)
tree6a940e6694436ce1ae182c2180f0c208958354a0
parent2603c7e69f54514861e18dbca0180010c955d8ff (diff)
Fix handling of multiple Link headers (that should not be a thing though)
-rw-r--r--app/services/fetch_atom_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb
index ada36b9f8..819bea02e 100644
--- a/app/services/fetch_atom_service.rb
+++ b/app/services/fetch_atom_service.rb
@@ -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?