lib/excon/hypermedia/middleware.rb in excon-hypermedia-0.6.0 vs lib/excon/hypermedia/middleware.rb in excon-hypermedia-0.7.0

- old
+ new

@@ -34,10 +34,12 @@ super end def response_call(datum) - return super unless (content_type = datum.dig(:response, :headers, 'Content-Type').to_s) + return super unless (headers = datum.dig(:response, :headers)) + return super unless (match = headers.find { |k, v| k.downcase == 'content-type' }) + content_type = match[1].to_s datum[:response][:hypermedia] = if datum[:hypermedia].nil? content_type.include?('hal+json') else datum[:hypermedia]