faraday_middleware-aws-signers-v4 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b03901381f827e2c229ace22d97a1f875d4f9e6
4
- data.tar.gz: 1ae6a545ace1c81005359eaeff6b19fb74437b25
3
+ metadata.gz: 4e3a9bbb3bb93756e5c618ba9638f60e606f6bc6
4
+ data.tar.gz: 2ce7743f98050c5dad4dc57e900743d2137b5935
5
5
  SHA512:
6
- metadata.gz: b6c9418fd4a22dcf156344de1f0aecd86e69f166358a2f8e3a1f17850337f8b90bc39752517fe9d47f8b36f6c733309486d77afe18b72f71d4f05f268d861208
7
- data.tar.gz: 1d6a77f6b3aeeee0003d700a0b8e5cdb647ed14a8dddb6d41510ad0c21d6356db45ea786e6677c4d424129cdbb908d8e172ec00e83e528506dd32d23abc7a3fb
6
+ metadata.gz: e18b946dfcc1b4d5858282549e9c009148fdf111509ec3b72a52d1d75bf70d3bf000197b32046cec8fedec2d94b2a1ca1318797c83798ceb41baf7db458bfeb1
7
+ data.tar.gz: d1dd306d49c26656c86e0f42874958fd14ed951511846afa710a813de4d3682ac2f602115ec7880e4fcc01862cc7b4f5fe255503d33c82d224f9786f7924485a
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = 'faraday_middleware-aws-signers-v4'
4
- spec.version = '0.1.3'
4
+ spec.version = '0.1.4'
5
5
  spec.authors = ['Genki Sugawara']
6
6
  spec.email = ['sgwr_dts@yahoo.co.jp']
7
7
 
@@ -0,0 +1,25 @@
1
+ require 'uri'
2
+ require 'aws-sdk'
3
+
4
+ module URI
5
+ def self.seahorse_encode_www_form(params)
6
+ params.map {|key, value|
7
+ encoded_key = encode_www_form_component(key)
8
+
9
+ if value.nil?
10
+ encoded_key
11
+ elsif value.respond_to?(:to_ary)
12
+ value.to_ary.map {|v|
13
+ if v.nil?
14
+ # bug?
15
+ #encoded_key
16
+ else
17
+ encoded_key + '=' + Seahorse::Util.uri_escape(v)
18
+ end
19
+ }.join('&')
20
+ else
21
+ encoded_key + '=' + Seahorse::Util.uri_escape(value)
22
+ end
23
+ }.join('&')
24
+ end
25
+ end
@@ -1,3 +1,4 @@
1
+ require 'faraday_middleware/ext/uri_ext'
1
2
  require 'faraday_middleware/aws_signers_v4_ext'
2
3
 
3
4
  class FaradayMiddleware::AwsSignersV4 < Faraday::Middleware
@@ -32,13 +33,13 @@ class FaradayMiddleware::AwsSignersV4 < Faraday::Middleware
32
33
  private
33
34
 
34
35
  def re_escape_query!(url)
35
- unescaped = CGI.unescape(url.query)
36
+ params = URI.decode_www_form(url.query)
36
37
 
37
- if unescaped =~ / /
38
- url.query = Seahorse::Util.uri_escape(unescaped)
38
+ if params.any? {|k, v| v =~ / / }
39
+ url.query = URI.seahorse_encode_www_form(params)
39
40
  end
40
41
  end
41
- end
42
+ end # of class Request
42
43
 
43
44
  def initialize(app, options = nil)
44
45
  super(app)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday_middleware-aws-signers-v4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -141,6 +141,7 @@ files:
141
141
  - faraday_middleware-aws-signers-v4.gemspec
142
142
  - lib/faraday_middleware/aws_signers_v4.rb
143
143
  - lib/faraday_middleware/aws_signers_v4_ext.rb
144
+ - lib/faraday_middleware/ext/uri_ext.rb
144
145
  - lib/faraday_middleware/request/aws_signers_v4.rb
145
146
  homepage: https://github.com/winebarrel/faraday_middleware-aws-signers-v4
146
147
  licenses: