excon 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/changelog.txt +7 -0
- data/lib/excon/middlewares/redirect_follower.rb +2 -1
- data/lib/excon/socket.rb +2 -1
- data/lib/excon/ssl_socket.rb +1 -0
- data/lib/excon/version.rb +1 -1
- data/tests/middlewares/redirect_follower_tests.rb +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbc090e0e340afbb9c9897d1e733c2870b2c6d9
|
4
|
+
data.tar.gz: f9015ceea2e07c05d07d16010f87472e26da17d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd222964f9f5bb2ca96af3f41fa00174e75fab56865223342405cb67869dbb46c526e0b7f8a87fff68485c724ec70e2ae5f982fe4cf3a8faeb49eee7dfe31742
|
7
|
+
data.tar.gz: 3a44275a35d4bb40f7af4b079daed73d115aa6e2adfc0b3746384486ec37dfb4d640eed3826f592ff9d3bf86187a8d79e9922945afea023271fa5634dc28b53e
|
data/.travis.yml
CHANGED
data/changelog.txt
CHANGED
@@ -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
|
-
|
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)
|
data/lib/excon/socket.rb
CHANGED
@@ -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], @
|
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
|
data/lib/excon/ssl_socket.rb
CHANGED
data/lib/excon/version.rb
CHANGED
@@ -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.
|
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:
|
13
|
+
date: 2018-03-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|