From ecf0cc03906631f3ae8cde9321f5f57541e0ba87 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 7 Jun 2011 15:28:38 -0700 Subject: [PATCH] [aws] use AWS.escape instead of CGI.escape --- lib/fog/providers/aws.rb | 2 +- lib/fog/storage/aws.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/providers/aws.rb b/lib/fog/providers/aws.rb index 8ec5bb68b..6721f2ce4 100644 --- a/lib/fog/providers/aws.rb +++ b/lib/fog/providers/aws.rb @@ -63,7 +63,7 @@ module Fog end string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop signed_string = options[:hmac].sign(string_to_sign) - body << "Signature=#{CGI.escape(Base64.encode64(signed_string).chomp!).gsub(/\+/, '%20')}" + body << "Signature=#{escape(Base64.encode64(signed_string).chomp!)}" body end diff --git a/lib/fog/storage/aws.rb b/lib/fog/storage/aws.rb index 4740d253c..adf89c6ac 100644 --- a/lib/fog/storage/aws.rb +++ b/lib/fog/storage/aws.rb @@ -69,7 +69,7 @@ module Fog query << "#{key}=#{Fog::AWS.escape(value)}" end query << "AWSAccessKeyId=#{@aws_access_key_id}" - query << "Signature=#{CGI.escape(signature(params))}" + query << "Signature=#{Fog::AWS.escape(signature(params))}" query << "Expires=#{params[:headers]['Date']}" "https://#{@host}/#{params[:path]}?#{query.join('&')}" end