mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-07 00:11:11 -04:00
Merge pull request #381 from alagu/master
Fix ActiveSupport::SafeBuffer#gsub bug
This commit is contained in:
commit
022afd8334
@ -3,8 +3,8 @@ module Faraday
|
||||
ESCAPE_RE = /[^a-zA-Z0-9 .~_-]/
|
||||
|
||||
def self.escape(s)
|
||||
return s.to_s.gsub(ESCAPE_RE) {
|
||||
'%' + $&.unpack('H2' * $&.bytesize).join('%').upcase
|
||||
s.to_s.gsub(ESCAPE_RE) {|match|
|
||||
'%' + match.unpack('H2' * match.bytesize).join('%').upcase
|
||||
}.tr(' ', '+')
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user