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:
parent
fc7345886a
commit
a92f5457e5
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue