mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|storage] fixes for directory/files
This commit is contained in:
parent
1cde6c4aa9
commit
a063173ba9
2 changed files with 7 additions and 4 deletions
|
@ -40,7 +40,7 @@ module Fog
|
|||
requires :key
|
||||
@public_url ||= begin
|
||||
begin response = connection.cdn.head_container(key)
|
||||
response.headers['X-CDN-URI']
|
||||
response.headers['X-CDN-Enabled'] == 'True' && response.headers['X-CDN-URI']
|
||||
rescue Fog::Service::NotFound
|
||||
nil
|
||||
end
|
||||
|
@ -51,7 +51,10 @@ module Fog
|
|||
requires :key
|
||||
connection.put_container(key)
|
||||
if @public
|
||||
@public_url = connection.cdn.put_container(key).headers['X-CDN-URI']
|
||||
@public_url = connection.cdn.put_container(key, 'X-CDN-Enabled' => 'True').headers['X-CDN-URI']
|
||||
else
|
||||
connection.cdn.put_container(key, 'X-CDN-Enabled' => 'False')
|
||||
@public_url = nil
|
||||
end
|
||||
true
|
||||
end
|
||||
|
|
|
@ -49,12 +49,12 @@ module Fog
|
|||
|
||||
def get_url(key, expires)
|
||||
requires :directory
|
||||
connection.get_object_url(directory.name, key, expires)
|
||||
connection.get_object_url(directory.key, key, expires)
|
||||
end
|
||||
|
||||
def head(key, options = {})
|
||||
requires :directory
|
||||
data = connection.head_object(directory.name, key, options)
|
||||
data = connection.head_object(directory.key, key)
|
||||
file_data = data.headers.merge({
|
||||
:key => key
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue