excon 0.101.0 → 0.103.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/README.md +5 -0
- data/lib/excon/connection.rb +2 -2
- data/lib/excon/constants.rb +27 -24
- data/lib/excon/socket.rb +4 -1
- data/lib/excon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c1759dde8542ab4e6147d2c51ce7e674d4fdd46b48f0aed3a77ed823917d336
|
4
|
+
data.tar.gz: 5c4c66737d283ed9d4d186cd46809c5c2fd0fc346c06564140b39a131fdfb44f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 803189e9d2dc991e48114c4f5ec7071ff04e4ea3f88d6872b3bcfe066cda38055c98b44cad83e5b9edabb677684b75c1a673c232303826a87857ba214c75cf6b
|
7
|
+
data.tar.gz: cab31317bdbc12398a33ce0b4a385584ca5c3e1cd2be2b201fb5e7ac0161b330e235d0ecd489fa304356367ab98fc868cc610d3afaf12bd3b4636ea182cda92e
|
data/README.md
CHANGED
@@ -191,6 +191,11 @@ connection = Excon.new('http://geemus.com/', :connect_timeout => 360)
|
|
191
191
|
|
192
192
|
# opt-out of nonblocking operations for performance and/or as a workaround
|
193
193
|
connection = Excon.new('http://geemus.com/', :nonblock => false)
|
194
|
+
|
195
|
+
# set up desired dns_timeouts for resolving addresses (default is set by Resolv)
|
196
|
+
# it accepts an integer or an array of integers for retrying with different timeouts
|
197
|
+
# see Resolv::DNS#timeouts for more details (https://ruby-doc.org/3.2.2/stdlibs/resolv/Resolv/DNS.html#method-i-timeouts-3D)
|
198
|
+
connection = Excon.new('http://geemus.com/', :dns_timeouts => 3)
|
194
199
|
```
|
195
200
|
|
196
201
|
## Chunked Requests
|
data/lib/excon/connection.rb
CHANGED
@@ -246,9 +246,9 @@ module Excon
|
|
246
246
|
|
247
247
|
host_key = datum[:headers].keys.detect {|k| k.casecmp('Host') == 0 } || 'Host'
|
248
248
|
if datum[:scheme] == UNIX
|
249
|
-
datum[:headers][host_key]
|
249
|
+
datum[:headers][host_key] ||= ''
|
250
250
|
else
|
251
|
-
datum[:headers][host_key]
|
251
|
+
datum[:headers][host_key] ||= datum[:host] + port_string(datum)
|
252
252
|
end
|
253
253
|
|
254
254
|
# RFC 7230, section 5.4, states that the Host header SHOULD be the first one # to be present.
|
data/lib/excon/constants.rb
CHANGED
@@ -46,6 +46,7 @@ module Excon
|
|
46
46
|
:chunk_size,
|
47
47
|
:debug_request,
|
48
48
|
:debug_response,
|
49
|
+
:dns_timeouts,
|
49
50
|
:headers,
|
50
51
|
:instrumentor, # Used for setting logging within Connection
|
51
52
|
:logger,
|
@@ -134,41 +135,43 @@ module Excon
|
|
134
135
|
end
|
135
136
|
# these come last as they rely on the above
|
136
137
|
DEFAULTS = {
|
137
|
-
:chunk_size
|
138
|
+
:chunk_size => CHUNK_SIZE || DEFAULT_CHUNK_SIZE,
|
138
139
|
# see https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
|
139
140
|
# list provided then had DES related things sorted to the end
|
140
|
-
:ciphers
|
141
|
-
:connect_timeout
|
142
|
-
:debug_request
|
143
|
-
:debug_response
|
144
|
-
:
|
141
|
+
:ciphers => 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA:!DSS',
|
142
|
+
:connect_timeout => 60,
|
143
|
+
:debug_request => false,
|
144
|
+
:debug_response => false,
|
145
|
+
:dns_timeouts => nil,
|
146
|
+
# nil allows Resolv::DNS to set its default timeouts value (see https://ruby-doc.org/3.2.2/stdlibs/resolv/Resolv/DNS.html#method-i-timeouts-3D)
|
147
|
+
:headers => {
|
145
148
|
'User-Agent' => USER_AGENT,
|
146
149
|
'Accept' => '*/*'
|
147
150
|
},
|
148
|
-
:idempotent
|
149
|
-
:instrumentor_name
|
150
|
-
:middlewares
|
151
|
+
:idempotent => false,
|
152
|
+
:instrumentor_name => 'excon',
|
153
|
+
:middlewares => [
|
151
154
|
Excon::Middleware::ResponseParser,
|
152
155
|
Excon::Middleware::Expects,
|
153
156
|
Excon::Middleware::Idempotent,
|
154
157
|
Excon::Middleware::Instrumentor,
|
155
158
|
Excon::Middleware::Mock
|
156
159
|
],
|
157
|
-
:mock
|
158
|
-
:nonblock
|
159
|
-
:omit_default_port
|
160
|
-
:persistent
|
161
|
-
:read_timeout
|
162
|
-
:retry_errors
|
163
|
-
:retry_limit
|
164
|
-
:ssl_verify_peer
|
165
|
-
:ssl_uri_schemes
|
166
|
-
:stubs
|
167
|
-
:tcp_nodelay
|
168
|
-
:thread_safe_sockets
|
169
|
-
:uri_parser
|
170
|
-
:versions
|
171
|
-
:write_timeout
|
160
|
+
:mock => false,
|
161
|
+
:nonblock => true,
|
162
|
+
:omit_default_port => false,
|
163
|
+
:persistent => false,
|
164
|
+
:read_timeout => 60,
|
165
|
+
:retry_errors => DEFAULT_RETRY_ERRORS,
|
166
|
+
:retry_limit => DEFAULT_RETRY_LIMIT,
|
167
|
+
:ssl_verify_peer => true,
|
168
|
+
:ssl_uri_schemes => [HTTPS],
|
169
|
+
:stubs => :global,
|
170
|
+
:tcp_nodelay => false,
|
171
|
+
:thread_safe_sockets => true,
|
172
|
+
:uri_parser => URI,
|
173
|
+
:versions => VERSIONS,
|
174
|
+
:write_timeout => 60
|
172
175
|
}
|
173
176
|
|
174
177
|
end
|
data/lib/excon/socket.rb
CHANGED
@@ -121,7 +121,10 @@ module Excon
|
|
121
121
|
family = @data[:proxy][:family]
|
122
122
|
end
|
123
123
|
|
124
|
-
Resolv.
|
124
|
+
dns_resolver = Resolv::DNS.new
|
125
|
+
dns_resolver.timeouts = @data[:dns_timeouts]
|
126
|
+
resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
|
127
|
+
resolver.each_address(hostname) do |ip|
|
125
128
|
# already succeeded on previous addrinfo
|
126
129
|
if @socket
|
127
130
|
break
|
data/lib/excon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.103.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dpiddy (Dan Peterson)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|