faraday 0.10.0 → 0.10.1
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.
- checksums.yaml +4 -4
- data/lib/faraday.rb +6 -4
- data/lib/faraday/adapter/httpclient.rb +10 -5
- data/lib/faraday/adapter/net_http.rb +1 -1
- data/lib/faraday/utils.rb +8 -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: e29dc411984d7a8c784de0e30c229cb35609b3c8
|
4
|
+
data.tar.gz: b4dbeba89b4f501785127f4011c8f7f40630f0b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d9e8cb2d15a1965167d6d7cbc1aa9413d04c8d02a3fc48c37052bccea72c51c555483c25e8448e0f254850d8dfcfbabc19568ecf2d09f909a2f1756c380851
|
7
|
+
data.tar.gz: 9ab178c28faabc70e789fc481b88ae70638356d8ae9a3c63d727b9d6d7d000d2fc7e8b50751b18a4bf102177ad8bc496850ae73bb7ff089fce0b4b69ed997657
|
data/lib/faraday.rb
CHANGED
@@ -14,7 +14,7 @@ require 'forwardable'
|
|
14
14
|
# conn.get '/'
|
15
15
|
#
|
16
16
|
module Faraday
|
17
|
-
VERSION = "0.10.
|
17
|
+
VERSION = "0.10.1"
|
18
18
|
|
19
19
|
class << self
|
20
20
|
# Public: Gets or sets the root path that Faraday is being loaded from.
|
@@ -34,9 +34,6 @@ module Faraday
|
|
34
34
|
# Faraday.get "https://faraday.com"
|
35
35
|
attr_writer :default_connection
|
36
36
|
|
37
|
-
# Public: Sets the default options used when calling Faraday#new.
|
38
|
-
attr_writer :default_connection_options
|
39
|
-
|
40
37
|
# Public: Initializes a new Faraday::Connection.
|
41
38
|
#
|
42
39
|
# url - The optional String base URL to use as a prefix for all
|
@@ -122,6 +119,11 @@ module Faraday
|
|
122
119
|
@default_connection_options ||= ConnectionOptions.new
|
123
120
|
end
|
124
121
|
|
122
|
+
# Public: Sets the default options used when calling Faraday#new.
|
123
|
+
def self.default_connection_options=(options)
|
124
|
+
@default_connection_options = ConnectionOptions.from(options)
|
125
|
+
end
|
126
|
+
|
125
127
|
unless const_defined? :Timer
|
126
128
|
require 'timeout'
|
127
129
|
Timer = Timeout
|
@@ -48,7 +48,7 @@ module Faraday
|
|
48
48
|
else
|
49
49
|
raise Faraday::Error::ClientError, $!
|
50
50
|
end
|
51
|
-
rescue Errno::ECONNREFUSED,
|
51
|
+
rescue Errno::ECONNREFUSED, IOError
|
52
52
|
raise Faraday::Error::ConnectionFailed, $!
|
53
53
|
rescue => err
|
54
54
|
if defined?(OpenSSL) && OpenSSL::SSL::SSLError === err
|
@@ -97,10 +97,15 @@ module Faraday
|
|
97
97
|
|
98
98
|
def ssl_cert_store(ssl)
|
99
99
|
return ssl[:cert_store] if ssl[:cert_store]
|
100
|
-
#
|
101
|
-
|
102
|
-
|
103
|
-
cert_store
|
100
|
+
# Memoize the cert store so that the same one is passed to
|
101
|
+
# HTTPClient each time, to avoid resyncing SSL sesions when
|
102
|
+
# it's changed
|
103
|
+
@cert_store ||= begin
|
104
|
+
# Use the default cert store by default, i.e. system ca certs
|
105
|
+
cert_store = OpenSSL::X509::Store.new
|
106
|
+
cert_store.set_default_paths
|
107
|
+
cert_store
|
108
|
+
end
|
104
109
|
end
|
105
110
|
|
106
111
|
def ssl_verify_mode(ssl)
|
data/lib/faraday/utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Olson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|