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:
parent
9f25c5c6a3
commit
f7b457a782
2 changed files with 2 additions and 2 deletions
|
@ -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 = {})
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue