httpx 0.18.0 → 0.18.1
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/0_18_1.md +12 -0
- data/lib/httpx/connection/http1.rb +5 -2
- data/lib/httpx/connection/http2.rb +16 -3
- data/lib/httpx/connection.rb +4 -2
- data/lib/httpx/io/ssl.rb +4 -0
- data/lib/httpx/plugins/retries.rb +13 -10
- data/lib/httpx/version.rb +1 -1
- data/sig/connection/http1.rbs +5 -0
- data/sig/connection/http2.rbs +3 -0
- metadata +53 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc0ed6728252132961087b7747743f0011f2f8100eb9b242080b7ac29ce68752
|
4
|
+
data.tar.gz: 68c3c8f592d2e7599b7a5dcca4e9f73e7d61aba743bacb17d4c276c404203f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 162b4b96df5b3b76bccdbe5940ed09aac4dea1d4b019321b07f859912d5d9fb770080d69198c70e4fd69a745723e250bcfce34e76baa83fdf3352f63d0b14620
|
7
|
+
data.tar.gz: 63099247e157ddd0b1f01bdbd459a51500b5bb7ac0a624a93c09958efbd10ec2c79027c5bb932ccacfa3335a8f9d0c7691b835ac30eabbe1ed6f7ced3a47421d
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# 0.18.1
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* HTTP/1.1 pipelining logs were logging the previously-buffered requests all together for each triggered request, which created some confusion for users when reporting errors. This has been fixed.
|
6
|
+
* HTTP/2 coalescing is now skipped when performing TLS connections with VERIFY_NONE.
|
7
|
+
* HTTP/2 peer GOAWAY frames will now result in a (retryable) connection error, instead of being ignored and leaving a "ghost" connection behind.
|
8
|
+
* fixed total timeout call which was not raising the exception.
|
9
|
+
|
10
|
+
## Chore
|
11
|
+
|
12
|
+
This gem now requires MFA-based gem releases.
|
@@ -36,6 +36,8 @@ module HTTPX
|
|
36
36
|
|
37
37
|
request = @requests.first
|
38
38
|
|
39
|
+
return unless request
|
40
|
+
|
39
41
|
return :w if request.interests == :w || !@buffer.empty?
|
40
42
|
|
41
43
|
:r
|
@@ -313,8 +315,9 @@ module HTTPX
|
|
313
315
|
end
|
314
316
|
|
315
317
|
def join_headers(request)
|
316
|
-
|
317
|
-
|
318
|
+
headline = "#{request.verb.to_s.upcase} #{headline_uri(request)} HTTP/#{@version.join(".")}"
|
319
|
+
@buffer << headline << CRLF
|
320
|
+
log(color: :yellow) { "<- HEADLINE: #{headline.chomp.inspect}" }
|
318
321
|
extra_headers = set_protocol_headers(request)
|
319
322
|
join_headers2(request.headers.each(extra_headers))
|
320
323
|
log { "<- " }
|
@@ -16,6 +16,12 @@ module HTTPX
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
class GoawayError < Error
|
20
|
+
def initialize
|
21
|
+
super(0, :no_error)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
19
25
|
attr_reader :streams, :pending
|
20
26
|
|
21
27
|
def initialize(buffer, options)
|
@@ -302,7 +308,7 @@ module HTTPX
|
|
302
308
|
@drains.delete(request)
|
303
309
|
@streams.delete(request)
|
304
310
|
|
305
|
-
if error
|
311
|
+
if error
|
306
312
|
ex = Error.new(stream.id, error)
|
307
313
|
ex.set_backtrace(caller)
|
308
314
|
response = ErrorResponse.new(request, ex, request.options)
|
@@ -344,9 +350,16 @@ module HTTPX
|
|
344
350
|
|
345
351
|
def on_close(_last_frame, error, _payload)
|
346
352
|
is_connection_closed = @connection.state == :closed
|
347
|
-
if error
|
353
|
+
if error
|
348
354
|
@buffer.clear if is_connection_closed
|
349
|
-
|
355
|
+
if error == :no_error
|
356
|
+
ex = GoawayError.new
|
357
|
+
@pending.unshift(*@streams.keys)
|
358
|
+
@drains.clear
|
359
|
+
@streams.clear
|
360
|
+
else
|
361
|
+
ex = Error.new(0, error)
|
362
|
+
end
|
350
363
|
ex.set_backtrace(caller)
|
351
364
|
handle_error(ex)
|
352
365
|
end
|
data/lib/httpx/connection.rb
CHANGED
@@ -117,7 +117,8 @@ module HTTPX
|
|
117
117
|
def coalescable?(connection)
|
118
118
|
if @io.protocol == "h2" &&
|
119
119
|
@origin.scheme == "https" &&
|
120
|
-
connection.origin.scheme == "https"
|
120
|
+
connection.origin.scheme == "https" &&
|
121
|
+
@io.can_verify_peer?
|
121
122
|
@io.verify_hostname(connection.origin.host)
|
122
123
|
else
|
123
124
|
@origin == connection.origin
|
@@ -241,7 +242,7 @@ module HTTPX
|
|
241
242
|
if elapsed_time.negative?
|
242
243
|
ex = TotalTimeoutError.new(@total_timeout, "Timed out after #{@total_timeout} seconds")
|
243
244
|
ex.set_backtrace(caller)
|
244
|
-
on_error(
|
245
|
+
on_error(ex)
|
245
246
|
return
|
246
247
|
end
|
247
248
|
|
@@ -463,6 +464,7 @@ module HTTPX
|
|
463
464
|
transition(:closing)
|
464
465
|
transition(:closed)
|
465
466
|
emit(:reset)
|
467
|
+
|
466
468
|
@parser.reset if @parser
|
467
469
|
transition(:idle)
|
468
470
|
transition(:open)
|
data/lib/httpx/io/ssl.rb
CHANGED
@@ -27,6 +27,10 @@ module HTTPX
|
|
27
27
|
super
|
28
28
|
end
|
29
29
|
|
30
|
+
def can_verify_peer?
|
31
|
+
@ctx.verify_mode == OpenSSL::SSL::VERIFY_PEER
|
32
|
+
end
|
33
|
+
|
30
34
|
def verify_hostname(host)
|
31
35
|
return false if @ctx.verify_mode == OpenSSL::SSL::VERIFY_NONE
|
32
36
|
return false if !@io.respond_to?(:peer_cert) || @io.peer_cert.nil?
|
@@ -12,16 +12,19 @@ module HTTPX
|
|
12
12
|
# TODO: pass max_retries in a configure/load block
|
13
13
|
|
14
14
|
IDEMPOTENT_METHODS = %i[get options head put delete].freeze
|
15
|
-
RETRYABLE_ERRORS = [
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
RETRYABLE_ERRORS = [
|
16
|
+
IOError,
|
17
|
+
EOFError,
|
18
|
+
Errno::ECONNRESET,
|
19
|
+
Errno::ECONNABORTED,
|
20
|
+
Errno::EPIPE,
|
21
|
+
Errno::EINVAL,
|
22
|
+
Errno::ETIMEDOUT,
|
23
|
+
Parser::Error,
|
24
|
+
TLSError,
|
25
|
+
TimeoutError,
|
26
|
+
Connection::HTTP2::GoawayError,
|
27
|
+
].freeze
|
25
28
|
DEFAULT_JITTER = ->(interval) { interval * (0.5 * (1 + rand)) }
|
26
29
|
|
27
30
|
if ENV.key?("HTTPX_NO_JITTER")
|
data/lib/httpx/version.rb
CHANGED
data/sig/connection/http1.rbs
CHANGED
data/sig/connection/http2.rbs
CHANGED
metadata
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
15
|
+
prerelease: false
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
18
|
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
20
|
version: 0.4.1
|
20
21
|
type: :runtime
|
21
|
-
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
@@ -33,58 +33,59 @@ extra_rdoc_files:
|
|
33
33
|
- LICENSE.txt
|
34
34
|
- README.md
|
35
35
|
- doc/release_notes/0_0_1.md
|
36
|
-
- doc/release_notes/
|
37
|
-
- doc/release_notes/
|
38
|
-
- doc/release_notes/
|
36
|
+
- doc/release_notes/0_15_4.md
|
37
|
+
- doc/release_notes/0_14_5.md
|
38
|
+
- doc/release_notes/0_18_1.md
|
39
|
+
- doc/release_notes/0_1_0.md
|
39
40
|
- doc/release_notes/0_0_5.md
|
40
|
-
- doc/release_notes/
|
41
|
-
- doc/release_notes/
|
42
|
-
- doc/release_notes/
|
43
|
-
- doc/release_notes/
|
44
|
-
- doc/release_notes/
|
41
|
+
- doc/release_notes/0_15_0.md
|
42
|
+
- doc/release_notes/0_14_1.md
|
43
|
+
- doc/release_notes/0_0_4.md
|
44
|
+
- doc/release_notes/0_15_1.md
|
45
|
+
- doc/release_notes/0_14_0.md
|
46
|
+
- doc/release_notes/0_14_4.md
|
47
|
+
- doc/release_notes/0_18_0.md
|
48
|
+
- doc/release_notes/0_6_5.md
|
49
|
+
- doc/release_notes/0_13_0.md
|
50
|
+
- doc/release_notes/0_6_1.md
|
45
51
|
- doc/release_notes/0_11_2.md
|
52
|
+
- doc/release_notes/0_7_0.md
|
53
|
+
- doc/release_notes/0_6_0.md
|
54
|
+
- doc/release_notes/0_10_2.md
|
46
55
|
- doc/release_notes/0_11_3.md
|
47
|
-
- doc/release_notes/
|
48
|
-
- doc/release_notes/
|
56
|
+
- doc/release_notes/0_8_2.md
|
57
|
+
- doc/release_notes/0_6_4.md
|
49
58
|
- doc/release_notes/0_13_1.md
|
59
|
+
- doc/release_notes/0_12_0.md
|
60
|
+
- doc/release_notes/0_9_0.md
|
61
|
+
- doc/release_notes/0_6_3.md
|
62
|
+
- doc/release_notes/0_10_1.md
|
63
|
+
- doc/release_notes/0_11_0.md
|
64
|
+
- doc/release_notes/0_8_1.md
|
65
|
+
- doc/release_notes/0_5_0.md
|
66
|
+
- doc/release_notes/0_6_7.md
|
50
67
|
- doc/release_notes/0_13_2.md
|
51
|
-
- doc/release_notes/0_14_0.md
|
52
|
-
- doc/release_notes/0_14_1.md
|
53
|
-
- doc/release_notes/0_14_2.md
|
54
|
-
- doc/release_notes/0_14_3.md
|
55
|
-
- doc/release_notes/0_14_4.md
|
56
|
-
- doc/release_notes/0_14_5.md
|
57
|
-
- doc/release_notes/0_15_0.md
|
58
|
-
- doc/release_notes/0_15_1.md
|
59
|
-
- doc/release_notes/0_15_2.md
|
60
|
-
- doc/release_notes/0_15_3.md
|
61
|
-
- doc/release_notes/0_15_4.md
|
62
|
-
- doc/release_notes/0_16_0.md
|
63
|
-
- doc/release_notes/0_16_1.md
|
64
|
-
- doc/release_notes/0_17_0.md
|
65
|
-
- doc/release_notes/0_18_0.md
|
66
|
-
- doc/release_notes/0_1_0.md
|
67
|
-
- doc/release_notes/0_2_0.md
|
68
|
-
- doc/release_notes/0_2_1.md
|
69
|
-
- doc/release_notes/0_3_0.md
|
70
|
-
- doc/release_notes/0_3_1.md
|
71
|
-
- doc/release_notes/0_4_0.md
|
72
68
|
- doc/release_notes/0_4_1.md
|
73
|
-
- doc/release_notes/0_5_0.md
|
74
69
|
- doc/release_notes/0_5_1.md
|
75
|
-
- doc/release_notes/0_6_0.md
|
76
|
-
- doc/release_notes/0_6_1.md
|
77
|
-
- doc/release_notes/0_6_2.md
|
78
|
-
- doc/release_notes/0_6_3.md
|
79
|
-
- doc/release_notes/0_6_4.md
|
80
|
-
- doc/release_notes/0_6_5.md
|
81
70
|
- doc/release_notes/0_6_6.md
|
82
|
-
- doc/release_notes/
|
83
|
-
- doc/release_notes/
|
71
|
+
- doc/release_notes/0_4_0.md
|
72
|
+
- doc/release_notes/0_6_2.md
|
73
|
+
- doc/release_notes/0_10_0.md
|
74
|
+
- doc/release_notes/0_11_1.md
|
84
75
|
- doc/release_notes/0_8_0.md
|
85
|
-
- doc/release_notes/
|
86
|
-
- doc/release_notes/
|
87
|
-
- doc/release_notes/
|
76
|
+
- doc/release_notes/0_3_0.md
|
77
|
+
- doc/release_notes/0_15_2.md
|
78
|
+
- doc/release_notes/0_14_3.md
|
79
|
+
- doc/release_notes/0_2_1.md
|
80
|
+
- doc/release_notes/0_0_3.md
|
81
|
+
- doc/release_notes/0_16_1.md
|
82
|
+
- doc/release_notes/0_17_0.md
|
83
|
+
- doc/release_notes/0_0_2.md
|
84
|
+
- doc/release_notes/0_16_0.md
|
85
|
+
- doc/release_notes/0_3_1.md
|
86
|
+
- doc/release_notes/0_15_3.md
|
87
|
+
- doc/release_notes/0_14_2.md
|
88
|
+
- doc/release_notes/0_2_0.md
|
88
89
|
files:
|
89
90
|
- LICENSE.txt
|
90
91
|
- README.md
|
@@ -119,6 +120,7 @@ files:
|
|
119
120
|
- doc/release_notes/0_16_1.md
|
120
121
|
- doc/release_notes/0_17_0.md
|
121
122
|
- doc/release_notes/0_18_0.md
|
123
|
+
- doc/release_notes/0_18_1.md
|
122
124
|
- doc/release_notes/0_1_0.md
|
123
125
|
- doc/release_notes/0_2_0.md
|
124
126
|
- doc/release_notes/0_2_1.md
|
@@ -300,7 +302,8 @@ metadata:
|
|
300
302
|
documentation_uri: https://honeyryderchuck.gitlab.io/httpx/rdoc/
|
301
303
|
source_code_uri: https://gitlab.com/honeyryderchuck/httpx
|
302
304
|
homepage_uri: https://honeyryderchuck.gitlab.io/httpx/
|
303
|
-
|
305
|
+
rubygems_mfa_required: 'true'
|
306
|
+
post_install_message:
|
304
307
|
rdoc_options: []
|
305
308
|
require_paths:
|
306
309
|
- lib
|
@@ -315,8 +318,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
318
|
- !ruby/object:Gem::Version
|
316
319
|
version: '0'
|
317
320
|
requirements: []
|
318
|
-
rubygems_version: 3.
|
319
|
-
signing_key:
|
321
|
+
rubygems_version: 3.1.6
|
322
|
+
signing_key:
|
320
323
|
specification_version: 4
|
321
324
|
summary: HTTPX, to the future, and beyond
|
322
325
|
test_files: []
|