httpx 1.8.1 → 1.8.4
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_8_2.md +30 -0
- data/doc/release_notes/1_8_3.md +9 -0
- data/doc/release_notes/1_8_4.md +13 -0
- data/lib/httpx/adapters/webmock.rb +2 -1
- data/lib/httpx/buffer.rb +5 -0
- data/lib/httpx/callbacks.rb +2 -2
- data/lib/httpx/chainable.rb +2 -2
- data/lib/httpx/connection/http1.rb +1 -1
- data/lib/httpx/connection/http2.rb +69 -17
- data/lib/httpx/connection.rb +58 -14
- data/lib/httpx/errors.rb +3 -0
- data/lib/httpx/io/ssl.rb +18 -8
- data/lib/httpx/options.rb +21 -12
- data/lib/httpx/plugins/auth.rb +6 -5
- data/lib/httpx/plugins/cookies/cookie.rb +1 -1
- data/lib/httpx/plugins/cookies.rb +2 -2
- data/lib/httpx/plugins/follow_redirects.rb +28 -14
- data/lib/httpx/plugins/grpc/call.rb +4 -4
- data/lib/httpx/plugins/grpc/grpc_encoding.rb +2 -2
- data/lib/httpx/plugins/oauth.rb +4 -2
- data/lib/httpx/plugins/persistent.rb +15 -0
- data/lib/httpx/plugins/proxy/http.rb +27 -6
- data/lib/httpx/plugins/proxy.rb +13 -7
- data/lib/httpx/plugins/retries.rb +26 -9
- data/lib/httpx/plugins/server_sent_events.rb +2 -2
- data/lib/httpx/plugins/stream.rb +2 -2
- data/lib/httpx/plugins/tracing.rb +20 -7
- data/lib/httpx/request/body.rb +8 -5
- data/lib/httpx/request.rb +8 -5
- data/lib/httpx/resolver/multi.rb +2 -2
- data/lib/httpx/resolver/native.rb +4 -0
- data/lib/httpx/resolver/resolver.rb +2 -2
- data/lib/httpx/response/body.rb +2 -2
- data/lib/httpx/response.rb +7 -7
- data/lib/httpx/selector.rb +1 -1
- data/lib/httpx/session.rb +7 -3
- data/lib/httpx/transcoder/chunker.rb +2 -2
- data/lib/httpx/transcoder/json.rb +8 -9
- data/lib/httpx/transcoder/utils/deflater.rb +1 -2
- data/lib/httpx/version.rb +1 -1
- data/sig/connection/http2.rbs +15 -1
- data/sig/connection.rbs +4 -2
- data/sig/errors.rbs +2 -2
- data/sig/io/ssl.rbs +5 -0
- data/sig/plugins/auth.rbs +3 -3
- data/sig/plugins/persistent.rbs +4 -0
- data/sig/plugins/proxy/http.rbs +2 -0
- data/sig/plugins/retries.rbs +4 -2
- data/sig/plugins/tracing.rbs +1 -1
- data/sig/request.rbs +2 -1
- metadata +8 -2
|
@@ -51,21 +51,20 @@ module HTTPX::Transcoder
|
|
|
51
51
|
method(:json_load)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# rubocop:disable Style/SingleLineMethods
|
|
54
|
+
# rubocop:disable-next Style/SingleLineMethods
|
|
55
55
|
if defined?(MultiJson)
|
|
56
|
-
def json_load(
|
|
57
|
-
def json_dump(
|
|
56
|
+
def json_load(...); MultiJson.load(...); end
|
|
57
|
+
def json_dump(...); MultiJson.dump(...); end
|
|
58
58
|
elsif defined?(Oj)
|
|
59
|
-
def json_load(response,
|
|
59
|
+
def json_load(response, ...); Oj.load(response.to_s, ...); end
|
|
60
60
|
def json_dump(obj, options = {}); Oj.dump(obj, { mode: :compat }.merge(options)); end
|
|
61
61
|
elsif defined?(Yajl)
|
|
62
|
-
def json_load(response,
|
|
63
|
-
def json_dump(
|
|
62
|
+
def json_load(response, ...); Yajl::Parser.new(...).parse(response.to_s); end
|
|
63
|
+
def json_dump(...); Yajl::Encoder.encode(...); end
|
|
64
64
|
else
|
|
65
65
|
require "json"
|
|
66
|
-
def json_load(
|
|
67
|
-
def json_dump(
|
|
66
|
+
def json_load(...); ::JSON.parse(...); end
|
|
67
|
+
def json_dump(...); ::JSON.generate(...); end
|
|
68
68
|
end
|
|
69
|
-
# rubocop:enable Style/SingleLineMethods
|
|
70
69
|
end
|
|
71
70
|
end
|
|
@@ -55,7 +55,7 @@ module HTTPX
|
|
|
55
55
|
|
|
56
56
|
private
|
|
57
57
|
|
|
58
|
-
# rubocop:disable Naming/MemoizedInstanceVariableName
|
|
58
|
+
# rubocop:disable-next Naming/MemoizedInstanceVariableName
|
|
59
59
|
def buffer_deflate!
|
|
60
60
|
return @buffer if defined?(@buffer)
|
|
61
61
|
|
|
@@ -68,7 +68,6 @@ module HTTPX
|
|
|
68
68
|
|
|
69
69
|
@buffer = buffer
|
|
70
70
|
end
|
|
71
|
-
# rubocop:enable Naming/MemoizedInstanceVariableName
|
|
72
71
|
end
|
|
73
72
|
end
|
|
74
73
|
end
|
data/lib/httpx/version.rb
CHANGED
data/sig/connection/http2.rbs
CHANGED
|
@@ -116,11 +116,25 @@ module HTTPX
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
class GoawayError < Error
|
|
119
|
-
|
|
119
|
+
UNRECOVERABLE_ERRORS: Array[Symbol]
|
|
120
|
+
|
|
121
|
+
@code: Symbol
|
|
122
|
+
|
|
123
|
+
def initialize: (Symbol code, Integer last_stream_id) -> void
|
|
124
|
+
|
|
125
|
+
def last_stream_id: () -> Numeric
|
|
126
|
+
|
|
127
|
+
def unrecoverable?: () -> bool
|
|
120
128
|
end
|
|
121
129
|
|
|
122
130
|
class PingError < Error
|
|
123
131
|
def initialize: () -> void
|
|
124
132
|
end
|
|
133
|
+
|
|
134
|
+
class RstStreamError < Error
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
class RefusedStreamError < Error
|
|
138
|
+
end
|
|
125
139
|
end
|
|
126
140
|
end
|
data/sig/connection.rbs
CHANGED
|
@@ -32,10 +32,11 @@ module HTTPX
|
|
|
32
32
|
attr_accessor current_session: Session?
|
|
33
33
|
attr_accessor family: Integer?
|
|
34
34
|
|
|
35
|
+
attr_reader read_buffer: Buffer
|
|
36
|
+
attr_reader write_buffer: Buffer
|
|
37
|
+
|
|
35
38
|
|
|
36
39
|
@window_size: Integer
|
|
37
|
-
@read_buffer: Buffer
|
|
38
|
-
@write_buffer: Buffer
|
|
39
40
|
@inflight: Integer
|
|
40
41
|
@max_concurrent_requests: Integer?
|
|
41
42
|
@keep_alive_timeout: interval?
|
|
@@ -46,6 +47,7 @@ module HTTPX
|
|
|
46
47
|
@response_received_at: Float
|
|
47
48
|
@exhausted: bool
|
|
48
49
|
@cloned: bool
|
|
50
|
+
@previously_exhausted_with_error: bool
|
|
49
51
|
@coalesced_connection: instance?
|
|
50
52
|
@altsvc_connection: instance?
|
|
51
53
|
@sibling: instance?
|
data/sig/errors.rbs
CHANGED
|
@@ -31,9 +31,9 @@ module HTTPX
|
|
|
31
31
|
|
|
32
32
|
class RequestTimeoutError < TimeoutError
|
|
33
33
|
attr_reader request: Request
|
|
34
|
-
attr_reader response:
|
|
34
|
+
attr_reader response: untyped
|
|
35
35
|
|
|
36
|
-
def initialize: (Request request,
|
|
36
|
+
def initialize: (Request request, untyped response, interval timeout) -> void
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
class ReadTimeoutError < RequestTimeoutError
|
data/sig/io/ssl.rbs
CHANGED
|
@@ -9,6 +9,7 @@ module HTTPX
|
|
|
9
9
|
@ctx: OpenSSL::SSL::SSLContext
|
|
10
10
|
@verify_hostname: bool
|
|
11
11
|
@sni_hostname: String
|
|
12
|
+
@session_new_cb: (^(OpenSSL::SSL::Session sess) -> void)?
|
|
12
13
|
|
|
13
14
|
attr_writer ssl_session: OpenSSL::SSL::Session?
|
|
14
15
|
|
|
@@ -24,5 +25,9 @@ module HTTPX
|
|
|
24
25
|
|
|
25
26
|
# :nocov:
|
|
26
27
|
def try_ssl_connect: () -> void
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def init_session_new_cb: () -> void
|
|
27
32
|
end
|
|
28
33
|
end
|
data/sig/plugins/auth.rbs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module HTTPX
|
|
2
2
|
module Plugins
|
|
3
3
|
module Auth
|
|
4
|
-
type auth_header_value_type = String | ^(Request request) -> string
|
|
4
|
+
type auth_header_value_type = String | ^(?Request request, ?bool should_regenerate) -> string
|
|
5
5
|
|
|
6
6
|
interface _AuthOptions
|
|
7
7
|
def auth_header_value: () -> auth_header_value_type?
|
|
@@ -18,7 +18,7 @@ module HTTPX
|
|
|
18
18
|
@auth_header_value_mtx: Thread::Mutex
|
|
19
19
|
@skip_auth_header_value: bool
|
|
20
20
|
|
|
21
|
-
def authorization: (?string token, ?auth_header_type: string) ?{ (Request) -> string } -> instance
|
|
21
|
+
def authorization: (?string token, ?auth_header_type: string) ?{ (?Request, ?bool) -> string } -> instance
|
|
22
22
|
|
|
23
23
|
def bearer_auth: (?string token) ?{ (Request) -> string } -> instance
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ module HTTPX
|
|
|
28
28
|
|
|
29
29
|
private
|
|
30
30
|
|
|
31
|
-
def generate_auth_token: () -> String?
|
|
31
|
+
def generate_auth_token: (Request & RequestMethods request, bool should_regenerate) -> String?
|
|
32
32
|
|
|
33
33
|
def dynamic_auth_token?: (auth_header_value_type auth_header_value) -> boolish
|
|
34
34
|
end
|
data/sig/plugins/persistent.rbs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module HTTPX
|
|
2
2
|
module Plugins
|
|
3
3
|
module Persistent
|
|
4
|
+
SAFE_REONNECTABLE_ERRORS: Array[singleton(StandardError)]
|
|
5
|
+
|
|
4
6
|
def self.load_dependencies: (singleton(Session)) -> void
|
|
5
7
|
|
|
6
8
|
def self.extra_options: (Options) -> (Options)
|
|
@@ -9,6 +11,8 @@ module HTTPX
|
|
|
9
11
|
private
|
|
10
12
|
|
|
11
13
|
def reconnectable_error?: (StandardError error) -> bool
|
|
14
|
+
|
|
15
|
+
def safe_reconnectable_error?: (StandardError error) -> bool
|
|
12
16
|
end
|
|
13
17
|
end
|
|
14
18
|
|
data/sig/plugins/proxy/http.rbs
CHANGED
data/sig/plugins/retries.rbs
CHANGED
|
@@ -45,9 +45,11 @@ module HTTPX
|
|
|
45
45
|
|
|
46
46
|
def try_partial_retry: (retriesRequest request, retriesResponse response) -> void
|
|
47
47
|
|
|
48
|
-
def prepare_to_retry: (
|
|
48
|
+
def prepare_to_retry: (retriesRequest request, retriesResponse response) -> void
|
|
49
49
|
|
|
50
|
-
def
|
|
50
|
+
def can_reconnect?: (retriesRequest request, retriesResponse response) -> bool
|
|
51
|
+
|
|
52
|
+
def when_to_retry: (retriesRequest request, retriesResponse response, retriesOptions options) -> Numeric?
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
module RequestMethods
|
data/sig/plugins/tracing.rbs
CHANGED
data/sig/request.rbs
CHANGED
|
@@ -32,10 +32,11 @@ module HTTPX
|
|
|
32
32
|
@query: String?
|
|
33
33
|
@drainer: Enumerator[String, void]?
|
|
34
34
|
@started: bool
|
|
35
|
+
@complete: bool
|
|
35
36
|
|
|
36
37
|
def initialize: (Symbol | String verb, generic_uri uri, Options options, ?request_params params) -> untyped
|
|
37
38
|
|
|
38
|
-
def complete!: (?response response) ->
|
|
39
|
+
def complete!: (?response response) -> bool
|
|
39
40
|
|
|
40
41
|
def started?: () -> bool
|
|
41
42
|
|
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.8.
|
|
4
|
+
version: 1.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tiago Cardoso
|
|
@@ -170,6 +170,9 @@ extra_rdoc_files:
|
|
|
170
170
|
- doc/release_notes/1_7_8.md
|
|
171
171
|
- doc/release_notes/1_8_0.md
|
|
172
172
|
- doc/release_notes/1_8_1.md
|
|
173
|
+
- doc/release_notes/1_8_2.md
|
|
174
|
+
- doc/release_notes/1_8_3.md
|
|
175
|
+
- doc/release_notes/1_8_4.md
|
|
173
176
|
files:
|
|
174
177
|
- LICENSE.txt
|
|
175
178
|
- README.md
|
|
@@ -312,6 +315,9 @@ files:
|
|
|
312
315
|
- doc/release_notes/1_7_8.md
|
|
313
316
|
- doc/release_notes/1_8_0.md
|
|
314
317
|
- doc/release_notes/1_8_1.md
|
|
318
|
+
- doc/release_notes/1_8_2.md
|
|
319
|
+
- doc/release_notes/1_8_3.md
|
|
320
|
+
- doc/release_notes/1_8_4.md
|
|
315
321
|
- lib/httpx.rb
|
|
316
322
|
- lib/httpx/adapters/datadog.rb
|
|
317
323
|
- lib/httpx/adapters/faraday.rb
|
|
@@ -557,7 +563,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
557
563
|
- !ruby/object:Gem::Version
|
|
558
564
|
version: '0'
|
|
559
565
|
requirements: []
|
|
560
|
-
rubygems_version:
|
|
566
|
+
rubygems_version: 4.0.16
|
|
561
567
|
specification_version: 4
|
|
562
568
|
summary: HTTPX, to the future, and beyond
|
|
563
569
|
test_files: []
|