mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-05 00:02:14 -05:00
Merge pull request #321 from stripe/revert-299-brandur-uri-escape
Revert removal of `URI.escape`
This commit is contained in:
commit
2f09c74c01
@ -1,5 +1,3 @@
|
||||
require "webrick"
|
||||
|
||||
module Stripe
|
||||
module Util
|
||||
def self.objects_to_ids(h)
|
||||
@ -95,10 +93,7 @@ module Stripe
|
||||
end
|
||||
|
||||
def self.url_encode(key)
|
||||
# Unfortunately, URI.escape was deprecated. Here we use a method from
|
||||
# WEBrick instead given that it's a fairly close approximation (credit to
|
||||
# the AWS Ruby SDK for coming up with the technique).
|
||||
WEBrick::HTTPUtils.escape(key.to_s).gsub('%5B', '[').gsub('%5D', ']')
|
||||
URI.escape(key.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
|
||||
end
|
||||
|
||||
def self.flatten_params(params, parent_key=nil)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user