httpx 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes/1_1_2.md +12 -0
- data/lib/httpx/adapters/sentry.rb +7 -2
- data/lib/httpx/connection.rb +7 -5
- data/lib/httpx/pool.rb +2 -4
- data/lib/httpx/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 118700ac0c350952382970ddb1ed33d74d954e1ddd6c2f82bb032cc24a3a5d22
|
4
|
+
data.tar.gz: 160644aeefb2ed61a8bda67b7896bbd2a4a4211cf9283ebe4e9a244ac237e780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97d15923bd32a0378bcf54a147b37b308eda78a74f67f339467dd3130cffd0aab7dace5bb368dbf9f5a203f6bc73ea37db394e153107daaf3c81b389f269d849
|
7
|
+
data.tar.gz: 16e71f8eb94de6314a77b96620be5db341afa81f2fb026780bd467fa0aaa9aa3d395d3afca5f59ebbd3aae507b33c88d22a4c864e40bfa4b23031162a365bcb8
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# 1.1.2
|
2
|
+
|
3
|
+
## improvements
|
4
|
+
|
5
|
+
* only moving eden connections to idle when they're recycled.
|
6
|
+
|
7
|
+
## bugfixes
|
8
|
+
|
9
|
+
* skip closing a connection which is already closed during reset.
|
10
|
+
* sentry adapter: fixed `super` call which didn't have a super method (this prevented usinng sentry-enabled sessions with the `:retries` plugin).
|
11
|
+
* sentry adapter: fixing registering of sentry config.
|
12
|
+
* sentry adapter: do not propagate traces when relevant sdk options are disabled (such as `propagate_traces`).
|
@@ -27,6 +27,11 @@ module HTTPX::Plugins
|
|
27
27
|
def set_sentry_trace_header(request, sentry_span)
|
28
28
|
return unless sentry_span
|
29
29
|
|
30
|
+
config = ::Sentry.configuration
|
31
|
+
url = request.uri.to_s
|
32
|
+
|
33
|
+
return unless config.propagate_traces && config.trace_propagation_targets.any? { |target| url.match?(target) }
|
34
|
+
|
30
35
|
trace = ::Sentry.get_current_client.generate_sentry_trace(sentry_span)
|
31
36
|
request.headers[::Sentry::SENTRY_TRACE_HEADER_NAME] = trace if trace
|
32
37
|
end
|
@@ -91,7 +96,7 @@ module HTTPX::Plugins
|
|
91
96
|
|
92
97
|
module RequestMethods
|
93
98
|
def __sentry_enable_trace!
|
94
|
-
return
|
99
|
+
return if @__sentry_enable_trace
|
95
100
|
|
96
101
|
Tracer.call(self)
|
97
102
|
@__sentry_enable_trace = true
|
@@ -108,7 +113,7 @@ module HTTPX::Plugins
|
|
108
113
|
end
|
109
114
|
end
|
110
115
|
|
111
|
-
Sentry.register_patch do
|
116
|
+
Sentry.register_patch(:httpx) do
|
112
117
|
sentry_session = HTTPX.plugin(HTTPX::Plugins::Sentry)
|
113
118
|
|
114
119
|
HTTPX.send(:remove_const, :Session)
|
data/lib/httpx/connection.rb
CHANGED
@@ -90,7 +90,7 @@ module HTTPX
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def match?(uri, options)
|
93
|
-
return false if @state == :closing || @state == :closed
|
93
|
+
return false if !used? && (@state == :closing || @state == :closed)
|
94
94
|
|
95
95
|
return false if exhausted?
|
96
96
|
|
@@ -503,10 +503,12 @@ module HTTPX
|
|
503
503
|
@origins |= [origin]
|
504
504
|
end
|
505
505
|
parser.on(:close) do |force|
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
506
|
+
if @state != :closed
|
507
|
+
transition(:closing)
|
508
|
+
if force || @state == :idle
|
509
|
+
transition(:closed)
|
510
|
+
emit(:close)
|
511
|
+
end
|
510
512
|
end
|
511
513
|
end
|
512
514
|
parser.on(:close_handshake) do
|
data/lib/httpx/pool.rb
CHANGED
@@ -110,6 +110,7 @@ module HTTPX
|
|
110
110
|
end
|
111
111
|
|
112
112
|
if conn
|
113
|
+
conn.idling
|
113
114
|
@connections << conn
|
114
115
|
select_connection(conn)
|
115
116
|
end
|
@@ -227,10 +228,7 @@ module HTTPX
|
|
227
228
|
|
228
229
|
def unregister_connection(connection)
|
229
230
|
@connections.delete(connection)
|
230
|
-
if connection.used? && !@eden_connections.include?(connection)
|
231
|
-
@eden_connections << connection
|
232
|
-
connection.idling
|
233
|
-
end
|
231
|
+
@eden_connections << connection if connection.used? && !@eden_connections.include?(connection)
|
234
232
|
@connected_connections -= 1 if deselect_connection(connection)
|
235
233
|
end
|
236
234
|
|
data/lib/httpx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -133,6 +133,7 @@ extra_rdoc_files:
|
|
133
133
|
- doc/release_notes/1_0_2.md
|
134
134
|
- doc/release_notes/1_1_0.md
|
135
135
|
- doc/release_notes/1_1_1.md
|
136
|
+
- doc/release_notes/1_1_2.md
|
136
137
|
files:
|
137
138
|
- LICENSE.txt
|
138
139
|
- README.md
|
@@ -237,6 +238,7 @@ files:
|
|
237
238
|
- doc/release_notes/1_0_2.md
|
238
239
|
- doc/release_notes/1_1_0.md
|
239
240
|
- doc/release_notes/1_1_1.md
|
241
|
+
- doc/release_notes/1_1_2.md
|
240
242
|
- lib/httpx.rb
|
241
243
|
- lib/httpx/adapters/datadog.rb
|
242
244
|
- lib/httpx/adapters/faraday.rb
|