1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[rackspace][storage] allow for passing options to specify headers on put

This commit is contained in:
geemus 2010-10-07 11:10:01 -07:00
parent 91f875785d
commit ddabb17ee9
2 changed files with 6 additions and 5 deletions

View file

@ -41,9 +41,9 @@ module Fog
end
end
def save
def save(options = {})
requires :body, :directory, :key
data = connection.put_object(directory.name, @key, @body)
data = connection.put_object(directory.name, @key, @body, options)
@etag = data.headers['ETag']
true
end

View file

@ -8,12 +8,13 @@ module Fog
# ==== Parameters
# * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
#
def put_object(container, object, data)
def put_object(container, object, data, options = {})
data = parse_data(data)
headers = data[:headers].merge!(options)
response = storage_request(
:body => data[:body],
:expects => 201,
:headers => data[:headers],
:headers => headers,
:method => 'PUT',
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
)
@ -24,7 +25,7 @@ module Fog
class Mock
def put_object(container, object, data)
def put_object(container, object, data, options = {})
Fog::Mock.not_implemented
end