lib/intercom/request.rb in intercom-0.1.19 vs lib/intercom/request.rb in intercom-0.2.0
- old
+ new
@@ -60,10 +60,10 @@
set_common_headers(net_http_method, base_uri)
client(base_uri).start do |http|
response = http.request(net_http_method)
raise_errors_on_failure(response)
decoded = decode(response['content-encoding'], response.body)
- JSON.parse(decoded)
+ JSON.parse(decoded) unless decoded.empty?
end
rescue Timeout::Error
raise Intercom::ServiceUnavailableError
end