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

Escape source object name when copying

This commit is contained in:
Pratik Naik 2011-07-28 23:15:51 +01:00
parent 49febbcf83
commit a484870331

View file

@ -30,7 +30,7 @@ module Fog
# http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectCOPY.html # 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 = {}) 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({ request({
:expects => 200, :expects => 200,
:headers => headers, :headers => headers,