From a484870331ae4c6626d879b8e7783f477eef1775 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Thu, 28 Jul 2011 23:15:51 +0100 Subject: [PATCH] Escape source object name when copying --- lib/fog/storage/requests/aws/copy_object.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/storage/requests/aws/copy_object.rb b/lib/fog/storage/requests/aws/copy_object.rb index 5d30e5fa6..3a5234e2e 100644 --- a/lib/fog/storage/requests/aws/copy_object.rb +++ b/lib/fog/storage/requests/aws/copy_object.rb @@ -30,7 +30,7 @@ module Fog # http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {}) - headers = { 'x-amz-copy-source' => "/#{source_bucket_name}/#{source_object_name}" }.merge!(options) + headers = { 'x-amz-copy-source' => "/#{source_bucket_name}/#{CGI.escape(source_object_name)}" }.merge!(options) request({ :expects => 200, :headers => headers,