mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2169 from rackspace/no_body
[rackspace] updating to only parse json if the body of the response has data
This commit is contained in:
commit
7c9a8b43d0
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ module Fog
|
|||
private
|
||||
|
||||
def process_response(response)
|
||||
if response && response.body && response.body.is_a?(String) && Fog::Rackspace.json_response?(response)
|
||||
if response &&
|
||||
response.body &&
|
||||
response.body.is_a?(String) &&
|
||||
!response.body.strip.empty? &&
|
||||
Fog::Rackspace.json_response?(response)
|
||||
begin
|
||||
response.body = Fog::JSON.decode(response.body)
|
||||
rescue MultiJson::DecodeError => e
|
||||
|
|
Loading…
Add table
Reference in a new issue