excon 0.24.0 → 0.25.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.
- data/Gemfile.lock +1 -1
- data/changelog.txt +6 -0
- data/excon.gemspec +2 -2
- data/lib/excon.rb +7 -2
- data/lib/excon/constants.rb +2 -2
- data/lib/excon/ssl_socket.rb +7 -0
- metadata +3 -3
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 = '2013-06-
|
16
|
+
s.version = '0.25.0'
|
17
|
+
s.date = '2013-06-20'
|
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.rb
CHANGED
@@ -34,8 +34,7 @@ module Excon
|
|
34
34
|
:omit_default_port => false,
|
35
35
|
:read_timeout => 60,
|
36
36
|
:retry_limit => DEFAULT_RETRY_LIMIT,
|
37
|
-
:
|
38
|
-
:ssl_verify_peer => RbConfig::CONFIG['host_os'] !~ /mswin|win32|dos|cygwin|mingw/i,
|
37
|
+
:ssl_verify_peer => true,
|
39
38
|
:tcp_nodelay => false,
|
40
39
|
:uri_parser => URI,
|
41
40
|
:write_timeout => 60
|
@@ -136,6 +135,9 @@ module Excon
|
|
136
135
|
# @param [Hash<Symbol, >] request params to match against, omitted params match all
|
137
136
|
# @param [Hash<Symbol, >] response params to return from matched request or block to call with params
|
138
137
|
def stub(request_params = {}, response_params = nil)
|
138
|
+
if method = request_params.delete(:method)
|
139
|
+
request_params[:method] = method.to_s.downcase.to_sym
|
140
|
+
end
|
139
141
|
if url = request_params.delete(:url)
|
140
142
|
uri = URI.parse(url)
|
141
143
|
request_params.update(
|
@@ -168,6 +170,9 @@ module Excon
|
|
168
170
|
|
169
171
|
# get a stub matching params or nil
|
170
172
|
def stub_for(request_params={})
|
173
|
+
if method = request_params.delete(:method)
|
174
|
+
request_params[:method] = method.to_s.downcase.to_sym
|
175
|
+
end
|
171
176
|
Excon.stubs.each do |stub, response|
|
172
177
|
captures = { :headers => {} }
|
173
178
|
headers_match = !stub.has_key?(:headers) || stub[:headers].keys.all? do |key|
|
data/lib/excon/constants.rb
CHANGED
@@ -21,7 +21,7 @@ module Excon
|
|
21
21
|
|
22
22
|
HTTP_1_1 = " HTTP/1.1\r\n"
|
23
23
|
|
24
|
-
HTTP_VERBS = %w{connect delete get head options post put trace
|
24
|
+
HTTP_VERBS = %w{connect delete get head options patch post put trace}
|
25
25
|
|
26
26
|
HTTPS = 'https'
|
27
27
|
|
@@ -77,7 +77,7 @@ module Excon
|
|
77
77
|
:write_timeout
|
78
78
|
]
|
79
79
|
|
80
|
-
VERSION = '0.
|
80
|
+
VERSION = '0.25.0'
|
81
81
|
|
82
82
|
unless ::IO.const_defined?(:WaitReadable)
|
83
83
|
class ::IO
|
data/lib/excon/ssl_socket.rb
CHANGED
@@ -18,6 +18,13 @@ module Excon
|
|
18
18
|
ssl_context.ca_path = @data[:ssl_ca_path]
|
19
19
|
elsif @data[:ssl_ca_file]
|
20
20
|
ssl_context.ca_file = @data[:ssl_ca_file]
|
21
|
+
else # attempt default, fallback to bundled
|
22
|
+
ssl_context.cert_store = OpenSSL::X509::Store.new
|
23
|
+
if File.exists?(OpenSSL::Config::DEFAULT_CONFIG_FILE)
|
24
|
+
ssl_context.cert_store.set_default_paths
|
25
|
+
else
|
26
|
+
ssl_context.cert_store.add_file(DEFAULT_CA_FILE)
|
27
|
+
end
|
21
28
|
end
|
22
29
|
else
|
23
30
|
# turn verification off
|
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.25.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-06-
|
14
|
+
date: 2013-06-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -235,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
segments:
|
237
237
|
- 0
|
238
|
-
hash:
|
238
|
+
hash: 1571112237803767338
|
239
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
240
|
none: false
|
241
241
|
requirements:
|