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

Correction to the regular expression for unreserved characters.

This commit is contained in:
Joshua Napoli 2011-04-09 20:36:00 -04:00
parent 9f25c5c6a3
commit f7b457a782
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ module Fog
end
def self.escape(string)
string.gsub( /([^a-zA-Z0-9_.-~]+)/n ) { |match| '%' + match.unpack( 'H2' * match.size ).join( '%' ).upcase }
string.gsub( /([^-a-zA-Z0-9_.~]+)/n ) { |match| '%' + match.unpack( 'H2' * match.size ).join( '%' ).upcase }
end
def self.signed_params(params, options = {})

View file

@ -1,3 +1,3 @@
Shindo.tests('AWS | signed_params', ['aws']) do
returns( Fog::AWS.escape( "'Stop!' said Fred~" ) ) { "%27Stop%21%27%20said%20Fred~" }
returns( Fog::AWS.escape( "'Stop!' said Fred_-~." ) ) { "%27Stop%21%27%20said%20Fred_-~." }
end