excon 0.60.0 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d53fc3b2405c940418dfb4d8a4f268b11451a1e6
4
- data.tar.gz: 7275cf523885f25c3bf8eabbe8baca5d05cffd89
3
+ metadata.gz: edbc090e0e340afbb9c9897d1e733c2870b2c6d9
4
+ data.tar.gz: f9015ceea2e07c05d07d16010f87472e26da17d6
5
5
  SHA512:
6
- metadata.gz: 6eb4a446aeb95dcb4674837fea2651a06547c584b943e8e29d7e0b3093b728f6226084fa8d8d6a3bfe1a3c664ace754a075cdac863a0f7aab8100ca0092c0a78
7
- data.tar.gz: 6867048ad67822bf11426e2cd9fb90060c11f8849e8d685a7df660a2064d6382be0cdc14916f1cd1820c923a8cde2bb41d6a09363025bdeacc5c367fdb5c8d35
6
+ metadata.gz: bd222964f9f5bb2ca96af3f41fa00174e75fab56865223342405cb67869dbb46c526e0b7f8a87fff68485c724ec70e2ae5f982fe4cf3a8faeb49eee7dfe31742
7
+ data.tar.gz: 3a44275a35d4bb40f7af4b079daed73d115aa6e2adfc0b3746384486ec37dfb4d640eed3826f592ff9d3bf86187a8d79e9922945afea023271fa5634dc28b53e
@@ -16,8 +16,9 @@ rvm:
16
16
  - 2.0
17
17
  - 2.1
18
18
  - 2.2
19
- - 2.3.3
20
- - 2.4.1
19
+ - 2.3
20
+ - 2.4
21
+ - 2.5
21
22
  - jruby
22
23
  - rbx-3.2
23
24
  - ree
@@ -1,3 +1,10 @@
1
+ 0.61.0 2018-03-16
2
+ =================
3
+
4
+ use default ports for sockets if none specified
5
+ add ruby 2.4 and 2.5 to ci testing
6
+ follow relative location redirects
7
+
1
8
  0.60.0 2017-12-15
2
9
  =================
3
10
 
@@ -17,7 +17,8 @@ module Excon
17
17
  uri_parser = datum[:uri_parser] || Excon.defaults[:uri_parser]
18
18
 
19
19
  location = get_header(datum, 'Location')
20
- uri = uri_parser.parse(location)
20
+ base_uri = Excon::Utils.request_uri(datum)
21
+ uri = uri_parser.join(base_uri, location)
21
22
 
22
23
  # delete old/redirect response
23
24
  response = datum.delete(:response)
@@ -24,6 +24,7 @@ module Excon
24
24
  def initialize(data = {})
25
25
  @data = data
26
26
  @nonblock = data[:nonblock]
27
+ @port ||= @data[:port] || 80
27
28
  @read_buffer = String.new
28
29
  @eof = false
29
30
  connect
@@ -93,7 +94,7 @@ module Excon
93
94
  args = [@data[:proxy][:hostname], @data[:proxy][:port], family, ::Socket::Constants::SOCK_STREAM]
94
95
  else
95
96
  family = @data[:family] || ::Socket::Constants::AF_UNSPEC
96
- args = [@data[:hostname], @data[:port], family, ::Socket::Constants::SOCK_STREAM]
97
+ args = [@data[:hostname], @port, family, ::Socket::Constants::SOCK_STREAM]
97
98
  end
98
99
  if RUBY_VERSION >= '1.9.2' && defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
99
100
  args << nil << nil << false # no reverse lookup
@@ -6,6 +6,7 @@ module Excon
6
6
  end
7
7
 
8
8
  def initialize(data = {})
9
+ @port = data[:port] || 443
9
10
  super
10
11
 
11
12
  # create ssl context
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
- VERSION = '0.60.0'
3
+ VERSION = '0.61.0'
4
4
  end
@@ -62,6 +62,38 @@ Shindo.tests('Excon redirect support for relative Location headers') do
62
62
  env_restore
63
63
  end
64
64
 
65
+ Shindo.tests('Excon redirect support for relative Location headers with dot segments') do
66
+ env_init
67
+
68
+ tests("request(:method => :get, :path => '/foo/baz/').body").returns('/foo/bar/') do
69
+ Excon.stub(
70
+ { :path => '/foo/baz/' },
71
+ {
72
+ :headers => { 'Location' => '../bar/' },
73
+ :body => '/foo/baz/',
74
+ :status => 301
75
+ }
76
+ )
77
+
78
+ Excon.stub(
79
+ { :path => '/foo/bar/' },
80
+ {
81
+ :body => '/foo/bar/',
82
+ :status => 200
83
+ }
84
+ )
85
+
86
+ Excon.get(
87
+ 'http://127.0.0.1:9292',
88
+ :path => '/foo/baz/',
89
+ :middlewares => Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower],
90
+ :mock => true
91
+ ).body
92
+ end
93
+
94
+ env_restore
95
+ end
96
+
65
97
  Shindo.tests("Excon redirecting post request") do
66
98
  env_init
67
99
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.60.0
4
+ version: 0.61.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-15 00:00:00.000000000 Z
13
+ date: 2018-03-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec