[hp|network] Add a extra check for responses that return not JSON data.
This commit is contained in:
parent
fc7345886a
commit
a92f5457e5
|
@ -182,7 +182,11 @@ module Fog
|
|||
end
|
||||
end
|
||||
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
|
||||
response.body = Fog::JSON.decode(response.body)
|
||||
if response.body.nil? || response.body == 'null'
|
||||
response.body = ''
|
||||
else
|
||||
response.body = Fog::JSON.decode(response.body)
|
||||
end
|
||||
end
|
||||
response
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue