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

[AWS|storage] fix for versioned copy_object

This commit is contained in:
geemus 2012-02-08 12:19:36 -06:00
parent d5678ee86a
commit 6f0b06ddd9

View file

@ -62,13 +62,11 @@ module Fog
if source_object && target_bucket if source_object && target_bucket
response.status = 200 response.status = 200
target_object = source_object.dup target_object = source_object.dup
target_object.each do |version| target_object.merge!({'Key' => target_object_name})
version.merge!({'Key' => target_object_name}) target_bucket[:objects][target_object_name] = [target_object]
end
target_bucket[:objects][target_object_name] = target_object
response.body = { response.body = {
'ETag' => target_object.last['ETag'], 'ETag' => target_object['ETag'],
'LastModified' => Time.parse(target_object.last['Last-Modified']) 'LastModified' => Time.parse(target_object['Last-Modified'])
} }
else else
response.status = 404 response.status = 404