debian-mirror-gitlab/faraday-middleware-aws-signers-v4/lib/faraday_middleware/ext/uri_ext.rb

26 lines
570 B
Ruby
Raw Normal View History

2019-12-05 21:41:47 +05:30
require 'uri'
require 'aws-sdk-resources'
module URI
def self.seahorse_encode_www_form(params)
params.map {|key, value|
encoded_key = encode_www_form_component(key)
if value.nil?
encoded_key
elsif value.respond_to?(:to_ary)
value.to_ary.map {|v|
if v.nil?
# bug?
#encoded_key
else
encoded_key + '=' + Seahorse::Util.uri_escape(v)
end
}.join('&')
else
encoded_key + '=' + Seahorse::Util.uri_escape(value)
end
}.join('&')
end
end