1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[hp|network] Add a extra check for responses that return not JSON data.

This commit is contained in:
Rupak Ganguly 2013-04-15 17:47:06 -04:00
parent fc7345886a
commit a92f5457e5

View file

@ -182,8 +182,12 @@ module Fog
end
end
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
if response.body.nil? || response.body == 'null'
response.body = ''
else
response.body = Fog::JSON.decode(response.body)
end
end
response
end