excon 0.42.1 → 0.43.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 +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.txt +7 -0
- data/excon.gemspec +2 -2
- data/lib/excon/connection.rb +9 -2
- data/lib/excon/constants.rb +2 -1
- data/lib/excon/errors.rb +1 -1
- data/tests/proxy_tests.rb +18 -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: 77a0da513895a3cba30b16145e7bea66033973cb
|
4
|
+
data.tar.gz: c573a10ec3c2f569628b1c605dc6d47a25caecf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 740736aa1390923d0ce8d30b4739b149509cdfe445e5ea90ef21e2f1f69e1df2603d22d722b9d4ac835c349e503d03349fbfcdc978104057edcc1310d130c654
|
7
|
+
data.tar.gz: fa08c954a4fcb5bc746d3ab32194b7bb41fef491b86b8ac3d5e0436d6c816f3074232e4ee807b132fc450d53f2f84ffe3a770738e5130c7ec65818faa5feea76
|
data/Gemfile.lock
CHANGED
data/changelog.txt
CHANGED
data/excon.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'excon'
|
16
|
-
s.version = '0.
|
17
|
-
s.date = '
|
16
|
+
s.version = '0.43.0'
|
17
|
+
s.date = '2015-01-09'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon/connection.rb
CHANGED
@@ -392,6 +392,13 @@ module Excon
|
|
392
392
|
end
|
393
393
|
|
394
394
|
def setup_proxy
|
395
|
+
if @data[:disable_proxy]
|
396
|
+
if @data[:proxy]
|
397
|
+
raise ArgumentError, "`:disable_proxy` parameter and `:proxy` parameter cannot both be set at the same time."
|
398
|
+
end
|
399
|
+
return
|
400
|
+
end
|
401
|
+
|
395
402
|
unless @data[:scheme] == UNIX
|
396
403
|
if no_proxy_env = ENV["no_proxy"] || ENV["NO_PROXY"]
|
397
404
|
no_proxy_list = no_proxy_env.scan(/\*?\.?([^\s,:]+)(?::(\d+))?/i).map { |s| [s[0], s[1]] }
|
@@ -410,8 +417,8 @@ module Excon
|
|
410
417
|
@data.delete(:proxy)
|
411
418
|
when Hash
|
412
419
|
# no processing needed
|
413
|
-
when String
|
414
|
-
uri = URI.parse(@data[:proxy])
|
420
|
+
when String, URI
|
421
|
+
uri = @data[:proxy].is_a?(String) ? URI.parse(@data[:proxy]) : @data[:proxy]
|
415
422
|
@data[:proxy] = {
|
416
423
|
:host => uri.host,
|
417
424
|
# path is only sensible for a Unix socket proxy
|
data/lib/excon/constants.rb
CHANGED
data/lib/excon/errors.rb
CHANGED
@@ -8,7 +8,7 @@ module Excon
|
|
8
8
|
class SocketError < Error
|
9
9
|
attr_reader :socket_error
|
10
10
|
|
11
|
-
def initialize(socket_error=
|
11
|
+
def initialize(socket_error=Excon::Error.new)
|
12
12
|
if socket_error.message =~ /certificate verify failed/
|
13
13
|
super("Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or `Excon.defaults[:ssl_verify_peer] = false` (less secure).")
|
14
14
|
else
|
data/tests/proxy_tests.rb
CHANGED
@@ -66,6 +66,15 @@ Shindo.tests('Excon proxy support') do
|
|
66
66
|
tests('connection.data[:proxy][:scheme]').returns('http') do
|
67
67
|
connection.data[:proxy][:scheme]
|
68
68
|
end
|
69
|
+
|
70
|
+
tests('with disable_proxy set') do
|
71
|
+
connection = nil
|
72
|
+
|
73
|
+
tests('connection.data[:proxy]').returns(nil) do
|
74
|
+
connection = Excon.new('http://foo.com', :disable_proxy => true)
|
75
|
+
connection.data[:proxy]
|
76
|
+
end
|
77
|
+
end
|
69
78
|
end
|
70
79
|
|
71
80
|
tests('an https connection') do
|
@@ -83,6 +92,15 @@ Shindo.tests('Excon proxy support') do
|
|
83
92
|
tests('connection.data[:proxy][:scheme]').returns('http') do
|
84
93
|
connection.data[:proxy][:scheme]
|
85
94
|
end
|
95
|
+
|
96
|
+
tests('with disable_proxy set') do
|
97
|
+
connection = nil
|
98
|
+
|
99
|
+
tests('connection.data[:proxy]').returns(nil) do
|
100
|
+
connection = Excon.new('https://foo.com', :disable_proxy => true)
|
101
|
+
connection.data[:proxy]
|
102
|
+
end
|
103
|
+
end
|
86
104
|
end
|
87
105
|
|
88
106
|
tests('http proxy from the environment overrides config') do
|
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.43.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: 2015-01-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|