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

[aws|storage] Return the object version in the request header and set an attribute value in the model.

This commit is contained in:
Kevin Menard 2011-12-29 14:08:22 -05:00
parent eb75723f87
commit abf8b5e670
2 changed files with 4 additions and 0 deletions

View file

@ -22,6 +22,7 @@ module Fog
attribute :owner, :aliases => 'Owner'
attribute :storage_class, :aliases => ['x-amz-storage-class', 'StorageClass']
attribute :encryption, :aliases => 'x-amz-server-side-encryption'
attribute :version, :aliases => 'x-amz-version-id'
def acl=(new_acl)
valid_acls = ['private', 'public-read', 'public-read-write', 'authenticated-read']

View file

@ -96,6 +96,9 @@ module Fog
response.headers[key] = value
end
end
response.headers['x-amz-version-id'] = object['VersionId'] if bucket[:versioning]
unless block_given?
response.body = object[:body]
else