faraday 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc2292832e97072ea9b3292a56ee1c87e7f9ec19
4
- data.tar.gz: 9aea82166ae97ea282ba1a4b5efc4740effeea14
3
+ metadata.gz: e29dc411984d7a8c784de0e30c229cb35609b3c8
4
+ data.tar.gz: b4dbeba89b4f501785127f4011c8f7f40630f0b7
5
5
  SHA512:
6
- metadata.gz: ba7bc351e2111733af22e1666f86d877050cd3256d3322e0418773aaf1a8c7447a02a780b812b0f2549b558c4c38a606189dad3c2915ed48019def848b8bc65c
7
- data.tar.gz: d3cbb3fa12d1e37f162930bab8be286ca6b384e2ce622e8ebff9087386902b50aa318a423d054138d87064601034470a45d072c85bda910d29fbb84150a22a5f
6
+ metadata.gz: 92d9e8cb2d15a1965167d6d7cbc1aa9413d04c8d02a3fc48c37052bccea72c51c555483c25e8448e0f254850d8dfcfbabc19568ecf2d09f909a2f1756c380851
7
+ data.tar.gz: 9ab178c28faabc70e789fc481b88ae70638356d8ae9a3c63d727b9d6d7d000d2fc7e8b50751b18a4bf102177ad8bc496850ae73bb7ff089fce0b4b69ed997657
@@ -14,7 +14,7 @@ require 'forwardable'
14
14
  # conn.get '/'
15
15
  #
16
16
  module Faraday
17
- VERSION = "0.10.0"
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, EOFError
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
- # Use the default cert store by default, i.e. system ca certs
101
- cert_store = OpenSSL::X509::Store.new
102
- cert_store.set_default_paths
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)
@@ -10,7 +10,7 @@ module Faraday
10
10
  class Adapter
11
11
  class NetHttp < Faraday::Adapter
12
12
  NET_HTTP_EXCEPTIONS = [
13
- EOFError,
13
+ IOError,
14
14
  Errno::ECONNABORTED,
15
15
  Errno::ECONNREFUSED,
16
16
  Errno::ECONNRESET,
@@ -108,6 +108,14 @@ module Faraday
108
108
  }
109
109
  end
110
110
 
111
+ def init_with(coder)
112
+ @names = coder['names']
113
+ end
114
+
115
+ def encode_with(coder)
116
+ coder['names'] = @names
117
+ end
118
+
111
119
  protected
112
120
 
113
121
  def names
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.0
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-11 00:00:00.000000000 Z
11
+ date: 2016-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post