From 6f0b06ddd9c73693cf0e5a94a7a99140d49d66be Mon Sep 17 00:00:00 2001 From: geemus Date: Wed, 8 Feb 2012 12:19:36 -0600 Subject: [PATCH] [AWS|storage] fix for versioned copy_object --- lib/fog/aws/requests/storage/copy_object.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/fog/aws/requests/storage/copy_object.rb b/lib/fog/aws/requests/storage/copy_object.rb index eb2fb65c1..38a091b88 100644 --- a/lib/fog/aws/requests/storage/copy_object.rb +++ b/lib/fog/aws/requests/storage/copy_object.rb @@ -62,13 +62,11 @@ module Fog if source_object && target_bucket response.status = 200 target_object = source_object.dup - target_object.each do |version| - version.merge!({'Key' => target_object_name}) - end - target_bucket[:objects][target_object_name] = target_object + target_object.merge!({'Key' => target_object_name}) + target_bucket[:objects][target_object_name] = [target_object] response.body = { - 'ETag' => target_object.last['ETag'], - 'LastModified' => Time.parse(target_object.last['Last-Modified']) + 'ETag' => target_object['ETag'], + 'LastModified' => Time.parse(target_object['Last-Modified']) } else response.status = 404