Module: FaradayMiddleware::AwsSigV4Util
- Included in:
- AwsSigV4
- Defined in:
- lib/faraday_middleware/request/aws_sigv4_util.rb
Instance Method Summary collapse
Instance Method Details
#seahorse_encode_query(url) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/faraday_middleware/request/aws_sigv4_util.rb', line 5 def seahorse_encode_query(url) return url unless url.query params = URI.decode_www_form(url.query) if params.any? { |_, v| v["\s"] } url = url.dup url.query = seahorse_encode_www_form(params) end url end |
#seahorse_encode_www_form(params) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/faraday_middleware/request/aws_sigv4_util.rb', line 18 def seahorse_encode_www_form(params) params.flat_map do |key, value| encoded_key = URI.encode_www_form_component(key) if value.nil? encoded_key else Array(value).map do |v| if v.nil? # nothing to do else "#{encoded_key}=#{Aws::Sigv4::Signer.uri_escape(v)}" end end end end.join('&') end |