faraday-net_http 2.0.1 → 2.1.0

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: cb8f3076e586085a7873fca5fdbde1a06029ed302f415ccdc0725974e1b63d4d
4
- data.tar.gz: e4bf9d227da702db014a8009f7a284d16d57b4f389dd16e321804e3e610746dc
3
+ metadata.gz: e471698764d66a8adfeafe9e3bad0472da1548fd4607ad5558b67cfce4932b02
4
+ data.tar.gz: 8cac9b619ce0ed8fbc861e5f4dfc46339dd61b066ec685bd6bda5deaa0c13456
5
5
  SHA512:
6
- metadata.gz: 5008e8715fcd65cc2584abeda42a2e3ee2550b380e341b566b8071fc32566a8cbdba872592358f55d713c02edbdef0bb7a1ec977904245457c29f422722263b9
7
- data.tar.gz: cb75722d3bacd09ba573d2a2a6c2b8892c7fe9e729bc26403b549f1d9bdfe406438219e2d9a553c710ae99fd09308f4f55f198d069a91efab568ced36022ca88
6
+ metadata.gz: afd126506d6c8c2110cd71a561ae0923ae32946ec437ad2cc5acc04ee1b50c2a2a7ac4cb1cf0752b0f9afae4f1227fa7d0e5e7693dd1c478a5c9f03be5923d45
7
+ data.tar.gz: e9cbb0a9571ca1eefb2b30cbc02b45939272447dd976ff36f079b0f09d8adc2faaef0e0e918c552359e51ca85c69e1881616af516eaf30be96228b99b91ea2de
data/README.md CHANGED
@@ -24,7 +24,6 @@ Or install it yourself as:
24
24
  conn = Faraday.new(...) do |f|
25
25
  f.adapter :net_http do |http|
26
26
  # yields Net::HTTP
27
- http.idle_timeout = 100
28
27
  http.verify_callback = lambda do |preverify, cert_store|
29
28
  # do something here...
30
29
  end
@@ -15,6 +15,7 @@ module Faraday
15
15
  exceptions = [
16
16
  IOError,
17
17
  Errno::EADDRNOTAVAIL,
18
+ Errno::EALREADY,
18
19
  Errno::ECONNABORTED,
19
20
  Errno::ECONNREFUSED,
20
21
  Errno::ECONNRESET,
@@ -166,6 +167,7 @@ module Faraday
166
167
  http.ssl_version = ssl[:version] if ssl[:version]
167
168
  http.min_version = ssl[:min_version] if ssl[:min_version]
168
169
  http.max_version = ssl[:max_version] if ssl[:max_version]
170
+ http.verify_hostname = ssl[:verify_hostname] if verify_hostname_enabled?(http, ssl)
169
171
  end
170
172
 
171
173
  def configure_request(http, req)
@@ -210,7 +212,7 @@ module Faraday
210
212
  def encoded_body(http_response)
211
213
  body = http_response.body || +''
212
214
  /\bcharset=\s*(.+?)\s*(;|$)/.match(http_response['Content-Type']) do |match|
213
- content_charset = Encoding.find(match.captures.first)
215
+ content_charset = ::Encoding.find(match.captures.first)
214
216
  body = body.dup if body.frozen?
215
217
  body.force_encoding(content_charset)
216
218
  rescue ArgumentError
@@ -218,6 +220,10 @@ module Faraday
218
220
  end
219
221
  body
220
222
  end
223
+
224
+ def verify_hostname_enabled?(http, ssl)
225
+ http.respond_to?(:verify_hostname=) && ssl.key?(:verify_hostname)
226
+ end
221
227
  end
222
228
  end
223
229
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Faraday
4
4
  module NetHttp
5
- VERSION = '2.0.1'
5
+ VERSION = '2.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-net_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan van der Pas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -42,7 +42,7 @@ licenses:
42
42
  metadata:
43
43
  homepage_uri: https://github.com/lostisland/faraday-net_http
44
44
  source_code_uri: https://github.com/lostisland/faraday-net_http
45
- changelog_uri: https://github.com/lostisland/faraday-net_http/releases/tag/v2.0.1
45
+ changelog_uri: https://github.com/lostisland/faraday-net_http/releases/tag/v2.1.0
46
46
  post_install_message:
47
47
  rdoc_options: []
48
48
  require_paths: