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

[aws] use AWS.escape instead of CGI.escape

This commit is contained in:
geemus 2011-06-07 15:28:38 -07:00
parent 8fb8642d83
commit ecf0cc0390
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ module Fog
end end
string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop string_to_sign = "POST\n#{options[:host]}:#{options[:port]}\n#{options[:path]}\n" << body.chop
signed_string = options[:hmac].sign(string_to_sign) 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 body
end end

View file

@ -69,7 +69,7 @@ module Fog
query << "#{key}=#{Fog::AWS.escape(value)}" query << "#{key}=#{Fog::AWS.escape(value)}"
end end
query << "AWSAccessKeyId=#{@aws_access_key_id}" query << "AWSAccessKeyId=#{@aws_access_key_id}"
query << "Signature=#{CGI.escape(signature(params))}" query << "Signature=#{Fog::AWS.escape(signature(params))}"
query << "Expires=#{params[:headers]['Date']}" query << "Expires=#{params[:headers]['Date']}"
"https://#{@host}/#{params[:path]}?#{query.join('&')}" "https://#{@host}/#{params[:path]}?#{query.join('&')}"
end end