mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Don’t escape '/' characters in keys
Add test for this behaviour
This commit is contained in:
parent
31f101f824
commit
95b353ff7f
2 changed files with 5 additions and 1 deletions
|
@ -84,7 +84,7 @@ module Fog
|
|||
end
|
||||
|
||||
def self.escape(string)
|
||||
string.gsub(/([^a-zA-Z0-9_.\-~]+)/) {
|
||||
string.gsub(/([^a-zA-Z0-9_.\-~\/]+)/) {
|
||||
"%" + $1.unpack("H2" * $1.bytesize).join("%").upcase
|
||||
}
|
||||
end
|
||||
|
|
|
@ -2,4 +2,8 @@
|
|||
|
||||
Shindo.tests('AWS | signed_params', ['aws']) do
|
||||
returns( Fog::AWS.escape( "'Stöp!' said Fred_-~." ) ) { "%27St%C3%B6p%21%27%20said%20Fred_-~." }
|
||||
|
||||
tests('Keys can contain a hierarchical prefix which should not be escaped') do
|
||||
returns( Fog::AWS.escape( "key/with/prefix" ) ) { "key/with/prefix" }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue