mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace] more universally handle json parsing stuff for rackspace
This commit is contained in:
parent
9c1f4be6e8
commit
b679f0f559
2 changed files with 3 additions and 3 deletions
|
@ -122,7 +122,7 @@ module Fog
|
|||
:host => @storage_host,
|
||||
:path => "#{@storage_path}/#{params[:path]}",
|
||||
}), &block)
|
||||
if !response.body.empty? && parse_json
|
||||
if !response.body.empty? && parse_json && response.headers['Content-Type'] == 'application/json'
|
||||
response.body = JSON.parse(response.body)
|
||||
end
|
||||
response
|
||||
|
|
|
@ -9,11 +9,11 @@ module Fog
|
|||
# * name<~String> - Name for container, should be < 256 bytes and must not contain '/'
|
||||
#
|
||||
def put_container(name)
|
||||
response = storage_request({
|
||||
response = storage_request(
|
||||
:expects => [201, 202],
|
||||
:method => 'PUT',
|
||||
:path => CGI.escape(name)
|
||||
}, false)
|
||||
)
|
||||
response
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue