faraday-excon 2.2.0 → 2.4.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 +4 -4
- data/lib/faraday/adapter/excon.rb +24 -22
- data/lib/faraday/excon/version.rb +1 -1
- metadata +7 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73929aac6bc0fcf47ec852b326cbd6b9069028fb5c20c8a3744e2a4023be0f6c
|
4
|
+
data.tar.gz: b2434d370c485a6d23690acf3140d1f9099d6c4abb41b4e33798923fff00d002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac1fc9d8592643820591f584cc10af0815b208928df7640b89716eb0044360b571f8da6cb9a3fb4c30009e82d877e42a947c381bbd4dd8c6da204175f171baa
|
7
|
+
data.tar.gz: 0ae26c632ed1c85145373faa55452cd895004ab495b3fa39367bdcc9b339f5b1e8a6d40e12edc3d01e02361fbb86b74aa5d89ee470e04f8428efd9d37a9a5e42
|
@@ -4,15 +4,25 @@ module Faraday
|
|
4
4
|
class Adapter
|
5
5
|
# Excon adapter.
|
6
6
|
class Excon < Faraday::Adapter
|
7
|
+
OPTS_KEYS = [
|
8
|
+
%i[ciphers ciphers],
|
9
|
+
%i[client_cert client_cert],
|
10
|
+
%i[client_key client_key],
|
11
|
+
%i[certificate certificate],
|
12
|
+
%i[private_key private_key],
|
13
|
+
%i[ssl_ca_path ca_path],
|
14
|
+
%i[ssl_ca_file ca_file],
|
15
|
+
%i[ssl_version version],
|
16
|
+
%i[ssl_min_version min_version],
|
17
|
+
%i[ssl_max_version max_version]
|
18
|
+
].freeze
|
19
|
+
|
7
20
|
def build_connection(env)
|
8
|
-
if @connection_options[:persistent] && defined?(@connection)
|
9
|
-
return @connection
|
10
|
-
end
|
21
|
+
return @connection if @connection_options[:persistent] && defined?(@connection)
|
11
22
|
|
12
23
|
opts = opts_from_env(env)
|
13
24
|
|
14
|
-
# remove path & query
|
15
|
-
# because if it is persistent, it can re-use the conn
|
25
|
+
# remove path & query, because persistent can re-use connection
|
16
26
|
url = env[:url].dup
|
17
27
|
url.path = ''
|
18
28
|
url.query = nil
|
@@ -32,16 +42,21 @@ module Faraday
|
|
32
42
|
}
|
33
43
|
|
34
44
|
req = env[:request]
|
35
|
-
|
45
|
+
yielded = false
|
46
|
+
if env.stream_response?
|
36
47
|
total = 0
|
37
48
|
req_opts[:response_block] = lambda do |chunk, _remain, _total|
|
38
|
-
|
49
|
+
yielded = true
|
50
|
+
req.on_data.call(chunk, total += chunk.bytesize, env)
|
39
51
|
end
|
40
52
|
end
|
41
53
|
|
42
54
|
resp = connect_and_request(env, req_opts)
|
43
|
-
|
44
|
-
|
55
|
+
|
56
|
+
# duplicate env.stream_response helper behavior for empty streams
|
57
|
+
req.on_data.call(+'', 0, env) if req&.stream_response? && !yielded
|
58
|
+
|
59
|
+
save_response(env, resp.status.to_i, resp.body, resp.headers, resp.reason_phrase)
|
45
60
|
|
46
61
|
@app.call(env)
|
47
62
|
end
|
@@ -81,19 +96,6 @@ module Faraday
|
|
81
96
|
env[:url].scheme == 'https' && env[:ssl]
|
82
97
|
end
|
83
98
|
|
84
|
-
OPTS_KEYS = [
|
85
|
-
%i[ciphers ciphers],
|
86
|
-
%i[client_cert client_cert],
|
87
|
-
%i[client_key client_key],
|
88
|
-
%i[certificate certificate],
|
89
|
-
%i[private_key private_key],
|
90
|
-
%i[ssl_ca_path ca_path],
|
91
|
-
%i[ssl_ca_file ca_file],
|
92
|
-
%i[ssl_version version],
|
93
|
-
%i[ssl_min_version min_version],
|
94
|
-
%i[ssl_max_version max_version]
|
95
|
-
].freeze
|
96
|
-
|
97
99
|
def amend_opts_with_ssl!(opts, ssl)
|
98
100
|
opts[:ssl_verify_peer] = !!ssl.fetch(:verify, true)
|
99
101
|
# https://github.com/geemus/excon/issues/106
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@geemus"
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: excon
|
@@ -16,14 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
18
|
+
version: 1.0.0
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
25
|
+
version: 1.0.0
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: faraday
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,8 +62,8 @@ metadata:
|
|
63
62
|
homepage_uri: https://github.com/excon/faraday-excon
|
64
63
|
rubygems_mfa_required: 'true'
|
65
64
|
source_code_uri: https://github.com/excon/faraday-excon
|
66
|
-
changelog_uri: https://github.com/excon/faraday-excon/releases/tag/v2.
|
67
|
-
|
65
|
+
changelog_uri: https://github.com/excon/faraday-excon/releases/tag/v2.4.0
|
66
|
+
funding_uri: https://github.com/sponsors/geemus
|
68
67
|
rdoc_options: []
|
69
68
|
require_paths:
|
70
69
|
- lib
|
@@ -79,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
78
|
- !ruby/object:Gem::Version
|
80
79
|
version: '0'
|
81
80
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
83
|
-
signing_key:
|
81
|
+
rubygems_version: 3.6.9
|
84
82
|
specification_version: 4
|
85
83
|
summary: Faraday adapter for Excon
|
86
84
|
test_files: []
|