lib/nationbuilder/client.rb in nationbuilder-rb-1.4.2 vs lib/nationbuilder/client.rb in nationbuilder-rb-1.4.3
- old
+ new
@@ -125,10 +125,11 @@
def parse_response_body(response)
error = classify_response_error(response)
raise error if error
- if response.header['Content-Type'].first != 'application/json'
+ content_type = response.header['Content-Type'].first
+ unless content_type && content_type.include?('application/json')
return true
end
parsed_body(response.body).merge('status_code' => response.code)
end