faraday 0.15.2 → 0.15.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42be55b00611d618997b1a7ce9224433de94d05a3d8c58eded72c747169f03c2
4
- data.tar.gz: e1c9762524844227534b3a3fa29280675c4f6d9c08aa38fe3778b868b6ee0fdd
3
+ metadata.gz: 852fb909df9a9f6e729b77257fdde96a8f5f83dd382fa7476b6cf95927d86cde
4
+ data.tar.gz: 941d453ea5d0b52ceece2b961a3ff1a684e823d658db5fb205fa26745e1ed6e6
5
5
  SHA512:
6
- metadata.gz: 3d07058fb83243451c60d69a93fc45b4415da74b3daa6554140a6c0f2908cb50d29efc6d2573890fed8d72f4a7c92c14b4aa62ce2ec64a3b26569a8711902dcf
7
- data.tar.gz: 975c1fe201ee8772a954dd734a37f4dc7401ea278b4dbd21e17ddc11a5e87d7ad0a6141e73f18ec63255feb181f8be252ad7dad6b115cfb4362f970bcc339580
6
+ metadata.gz: e05cfb7ae7e6867dc06c0609098a86dd50197bb97ac67a4e91ed87cfbfa60b671f2886605737908aa5be7a15bffc0cb8063da2689eaf6deacbc03e7fa686d076
7
+ data.tar.gz: f3cd848e833cdb38fc2fc9d2587627fa12973c57b71c1574d4872c56abc90f4b05a9a4f7af659ae7bd6da1ccc7c3ef1f226c0153b14be8af2ed88f457c356d11
@@ -14,7 +14,7 @@ require 'forwardable'
14
14
  # conn.get '/'
15
15
  #
16
16
  module Faraday
17
- VERSION = "0.15.2"
17
+ VERSION = "0.15.3"
18
18
 
19
19
  class << self
20
20
  # Public: Gets or sets the root path that Faraday is being loaded from.
@@ -116,10 +116,15 @@ module Faraday
116
116
  end
117
117
 
118
118
  def configure_request(http, req)
119
- http.read_timeout = http.open_timeout = req[:timeout] if req[:timeout]
120
- http.open_timeout = req[:open_timeout] if req[:open_timeout]
121
- # Only set if Net::Http supports it, since Ruby 2.5.
122
- http.max_retries = 0 if http.respond_to?(:max_retries=)
119
+ if req[:timeout]
120
+ http.read_timeout = req[:timeout]
121
+ http.open_timeout = req[:timeout]
122
+ http.write_timeout = req[:timeout] if http.respond_to?(:write_timeout=)
123
+ end
124
+ http.open_timeout = req[:open_timeout] if req[:open_timeout]
125
+ http.write_timeout = req[:write_timeout] if req[:write_timeout] && http.respond_to?(:write_timeout=)
126
+ # Only set if Net::Http supports it, since Ruby 2.5.
127
+ http.max_retries = 0 if http.respond_to?(:max_retries=)
123
128
 
124
129
  @config_block.call(http) if @config_block
125
130
  end
@@ -202,7 +202,7 @@ module Faraday
202
202
  end
203
203
 
204
204
  class RequestOptions < Options.new(:params_encoder, :proxy, :bind,
205
- :timeout, :open_timeout, :boundary, :oauth, :context)
205
+ :timeout, :open_timeout, :write_timeout, :boundary, :oauth, :context)
206
206
 
207
207
  def []=(key, value)
208
208
  if key && key.to_sym == :proxy
@@ -69,6 +69,26 @@ module Faraday
69
69
  headers[key] = value
70
70
  end
71
71
 
72
+ def marshal_dump
73
+ {
74
+ :method => method,
75
+ :body => body,
76
+ :headers => headers,
77
+ :path => path,
78
+ :params => params,
79
+ :options => options
80
+ }
81
+ end
82
+
83
+ def marshal_load(serialised)
84
+ self.method = serialised[:method]
85
+ self.body = serialised[:body]
86
+ self.headers = serialised[:headers]
87
+ self.path = serialised[:path]
88
+ self.params = serialised[:params]
89
+ self.options = serialised[:options]
90
+ end
91
+
72
92
  # ENV Keys
73
93
  # :method - a symbolized request method (:get, :post)
74
94
  # :body - the request body that will eventually be converted to a string.
@@ -20,6 +20,7 @@ module Faraday
20
20
  #
21
21
  class Request::Retry < Faraday::Middleware
22
22
 
23
+ DEFAULT_EXCEPTIONS = [Errno::ETIMEDOUT, 'Timeout::Error', Error::TimeoutError, Faraday::Error::RetriableResponse].freeze
23
24
  IDEMPOTENT_METHODS = [:delete, :get, :head, :options, :put]
24
25
 
25
26
  class Options < Faraday::Options.new(:max, :interval, :max_interval, :interval_randomness,
@@ -57,9 +58,7 @@ module Faraday
57
58
  end
58
59
 
59
60
  def exceptions
60
- Array(self[:exceptions] ||= [Errno::ETIMEDOUT, 'Timeout::Error',
61
- Error::TimeoutError,
62
- Faraday::Error::RetriableResponse])
61
+ Array(self[:exceptions] ||= DEFAULT_EXCEPTIONS)
63
62
  end
64
63
 
65
64
  def methods
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.15.2
4
+ version: 0.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Olson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-23 00:00:00.000000000 Z
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post