httpx 1.6.1 → 1.6.2
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/doc/release_notes/1_6_2.md +11 -0
- data/lib/httpx/adapters/datadog.rb +15 -11
- data/lib/httpx/connection.rb +4 -0
- data/lib/httpx/resolver/multi.rb +2 -6
- data/lib/httpx/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c039169fa319d4e42cff7cb34d8a9cc7fc571e62565f673c32436645780222c
|
4
|
+
data.tar.gz: 6affb65b4fa71aa813cffc498034e0c6a6609bcdb0fca9d0ae9df738d4786d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21be43709d51f7c50d1624923bc1657c9f096b84686612ff70f660af320d71d94d28a52ccef05f27558d74f22e1fd307944ca8ddf8b6c74c0b322e83eaad9b19
|
7
|
+
data.tar.gz: c551d2b32a71c5bbf099283b3577abe80d5005f702af5edefb79f445296c37c8fb9afb3d52b18db254a0c4ddd115d5f45953549f9b3c99c90ff8b86aedd6cb91
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# 1.6.2
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* revert of behaviour introduced in 1.6.1 around handling of `:ip_families` for name resolution.
|
6
|
+
* when no option is passed, do not assume no IPv6 connectivity if no available non-local IP is found, as the local network may still be reachable under `[::]`.
|
7
|
+
* bail out connection if the tcp connection was established but the ssl session failed.
|
8
|
+
* when alpn negotiation succeeded, this could still initialize the HTTP/2 connection and put bytes in the buffer, which would cause a busy loop trying to write to a non-open socket.
|
9
|
+
* datadog: fix initialization of spans in non-connection related errors
|
10
|
+
* past code was relying on the error being around DNS, but other errors could pop; the fix was moving the init time setup early to the session, when a request is first passed ot the associated connection.
|
11
|
+
* it can also fail earlier, so provide a workaround for that as well.
|
@@ -180,7 +180,7 @@ module Datadog::Tracing
|
|
180
180
|
end
|
181
181
|
|
182
182
|
module RequestMethods
|
183
|
-
|
183
|
+
attr_accessor :init_time
|
184
184
|
|
185
185
|
# intercepts request initialization to inject the tracing logic.
|
186
186
|
def initialize(*)
|
@@ -193,26 +193,30 @@ module Datadog::Tracing
|
|
193
193
|
RequestTracer.call(self)
|
194
194
|
end
|
195
195
|
|
196
|
-
def response=(
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
196
|
+
def response=(*)
|
197
|
+
# init_time should be set when it's send to a connection.
|
198
|
+
# However, there are situations where connection initialization fails.
|
199
|
+
# Example is the :ssrf_filter plugin, which raises an error on
|
200
|
+
# initialize if the host is an IP which matches against the known set.
|
201
|
+
# in such cases, we'll just set here right here.
|
202
|
+
@init_time ||= ::Datadog::Core::Utils::Time.now.utc
|
203
|
+
|
204
204
|
super
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
208
|
module ConnectionMethods
|
209
|
-
attr_reader :init_time
|
210
|
-
|
211
209
|
def initialize(*)
|
212
210
|
super
|
213
211
|
|
214
212
|
@init_time = ::Datadog::Core::Utils::Time.now.utc
|
215
213
|
end
|
214
|
+
|
215
|
+
def send(request)
|
216
|
+
request.init_time ||= @init_time
|
217
|
+
|
218
|
+
super
|
219
|
+
end
|
216
220
|
end
|
217
221
|
end
|
218
222
|
|
data/lib/httpx/connection.rb
CHANGED
data/lib/httpx/resolver/multi.rb
CHANGED
@@ -69,11 +69,11 @@ module HTTPX
|
|
69
69
|
addresses = @resolver_options[:cache] && (connection.addresses || HTTPX::Resolver.nolookup_resolve(hostname))
|
70
70
|
return false unless addresses
|
71
71
|
|
72
|
-
ip_families = connection.options.ip_families
|
72
|
+
ip_families = connection.options.ip_families
|
73
73
|
|
74
74
|
resolved = false
|
75
75
|
addresses.group_by(&:family).sort { |(f1, _), (f2, _)| f2 <=> f1 }.each do |family, addrs|
|
76
|
-
next unless ip_families.include?(family)
|
76
|
+
next unless ip_families.nil? || ip_families.include?(family)
|
77
77
|
|
78
78
|
# try to match the resolver by family. However, there are cases where that's not possible, as when
|
79
79
|
# the system does not have IPv6 connectivity, but it does support IPv6 via loopback/link-local.
|
@@ -91,11 +91,7 @@ module HTTPX
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def lazy_resolve(connection)
|
94
|
-
ip_families = connection.options.ip_families || Resolver.supported_ip_families
|
95
|
-
|
96
94
|
@resolvers.each do |resolver|
|
97
|
-
next unless ip_families.include?(resolver.family)
|
98
|
-
|
99
95
|
resolver << @current_session.try_clone_connection(connection, @current_selector, resolver.family)
|
100
96
|
next if resolver.empty?
|
101
97
|
|
data/lib/httpx/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
@@ -157,6 +157,7 @@ extra_rdoc_files:
|
|
157
157
|
- doc/release_notes/1_5_1.md
|
158
158
|
- doc/release_notes/1_6_0.md
|
159
159
|
- doc/release_notes/1_6_1.md
|
160
|
+
- doc/release_notes/1_6_2.md
|
160
161
|
files:
|
161
162
|
- LICENSE.txt
|
162
163
|
- README.md
|
@@ -286,6 +287,7 @@ files:
|
|
286
287
|
- doc/release_notes/1_5_1.md
|
287
288
|
- doc/release_notes/1_6_0.md
|
288
289
|
- doc/release_notes/1_6_1.md
|
290
|
+
- doc/release_notes/1_6_2.md
|
289
291
|
- lib/httpx.rb
|
290
292
|
- lib/httpx/adapters/datadog.rb
|
291
293
|
- lib/httpx/adapters/faraday.rb
|