lib/excon/hypermedia/response.rb in excon-hypermedia-0.4.1 vs lib/excon/hypermedia/response.rb in excon-hypermedia-0.4.2
- old
+ new
@@ -35,10 +35,10 @@
def resource
@resource ||= ResourceObject.new(body_to_hash)
end
def body_to_hash
- content_type.include?('application/hal+json') ? JSON.parse(response.body) : {}
+ (content_type =~ %r{application/(hal\+)?json}).nil? ? {} : JSON.parse(response.body)
end
def content_type
response.headers['Content-Type'].to_s
end