httpx 1.8.4 → 1.9.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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/1_9_0.md +75 -0
  3. data/lib/httpx/adapters/webmock.rb +1 -1
  4. data/lib/httpx/altsvc.rb +29 -15
  5. data/lib/httpx/chainable.rb +4 -1
  6. data/lib/httpx/connection/http1.rb +11 -19
  7. data/lib/httpx/connection/http2.rb +48 -14
  8. data/lib/httpx/connection.rb +171 -47
  9. data/lib/httpx/headers.rb +2 -2
  10. data/lib/httpx/io/tcp.rb +18 -14
  11. data/lib/httpx/options.rb +86 -35
  12. data/lib/httpx/parser/http1.rb +3 -6
  13. data/lib/httpx/plugins/auth/digest.rb +1 -2
  14. data/lib/httpx/plugins/auth.rb +11 -2
  15. data/lib/httpx/plugins/aws_sdk_authentication.rb +7 -3
  16. data/lib/httpx/plugins/aws_sigv4.rb +1 -0
  17. data/lib/httpx/plugins/basic_auth.rb +2 -0
  18. data/lib/httpx/plugins/callbacks.rb +7 -6
  19. data/lib/httpx/plugins/circuit_breaker.rb +1 -0
  20. data/lib/httpx/plugins/digest_auth.rb +2 -0
  21. data/lib/httpx/plugins/expect.rb +2 -0
  22. data/lib/httpx/plugins/fiber_concurrency.rb +6 -0
  23. data/lib/httpx/plugins/follow_redirects.rb +1 -1
  24. data/lib/httpx/plugins/grpc.rb +21 -0
  25. data/lib/httpx/plugins/hedging.rb +284 -0
  26. data/lib/httpx/plugins/ntlm_auth.rb +1 -0
  27. data/lib/httpx/plugins/ntlm_v2_auth.rb +1 -0
  28. data/lib/httpx/plugins/oauth.rb +1 -1
  29. data/lib/httpx/plugins/proxy/http.rb +44 -10
  30. data/lib/httpx/plugins/proxy/ssh.rb +30 -11
  31. data/lib/httpx/plugins/proxy.rb +62 -41
  32. data/lib/httpx/plugins/push_promise.rb +4 -2
  33. data/lib/httpx/plugins/retries.rb +2 -2
  34. data/lib/httpx/plugins/server_sent_events.rb +1 -0
  35. data/lib/httpx/plugins/ssrf_filter.rb +1 -1
  36. data/lib/httpx/plugins/tracing.rb +58 -11
  37. data/lib/httpx/plugins/upgrade/h2.rb +1 -1
  38. data/lib/httpx/plugins/upgrade.rb +2 -0
  39. data/lib/httpx/plugins/webdav.rb +8 -0
  40. data/lib/httpx/request/body.rb +2 -1
  41. data/lib/httpx/request.rb +5 -5
  42. data/lib/httpx/resolver.rb +5 -1
  43. data/lib/httpx/response.rb +15 -7
  44. data/lib/httpx/selector.rb +3 -3
  45. data/lib/httpx/session.rb +36 -10
  46. data/lib/httpx/version.rb +1 -1
  47. data/sig/altsvc.rbs +3 -3
  48. data/sig/callbacks.rbs +1 -0
  49. data/sig/chainable.rbs +1 -0
  50. data/sig/connection/http1.rbs +1 -1
  51. data/sig/connection/http2.rbs +15 -15
  52. data/sig/connection.rbs +18 -1
  53. data/sig/headers.rbs +1 -1
  54. data/sig/httpx.rbs +2 -0
  55. data/sig/options.rbs +43 -12
  56. data/sig/parser/http1.rbs +1 -1
  57. data/sig/plugins/auth/digest.rbs +0 -1
  58. data/sig/plugins/auth.rbs +12 -5
  59. data/sig/plugins/hedging.rbs +44 -0
  60. data/sig/plugins/proxy/http.rbs +6 -1
  61. data/sig/plugins/proxy.rbs +3 -2
  62. data/sig/plugins/retries.rbs +2 -2
  63. data/sig/plugins/tracing.rbs +14 -5
  64. data/sig/request/body.rbs +1 -1
  65. data/sig/resolver/entry.rbs +2 -2
  66. data/sig/response.rbs +1 -2
  67. data/sig/selector.rbs +2 -2
  68. data/sig/session.rbs +7 -5
  69. metadata +5 -1
@@ -4,10 +4,10 @@ module HTTPX
4
4
 
5
5
  @expires_in: interval
6
6
 
7
- def initialize: (IPAddr | _ToS address, ?Numeric expires_in, ?rescue_on_convert: boolish) -> void
7
+ def initialize: (ipaddr address, ?Numeric expires_in, ?rescue_on_convert: boolish) -> void
8
8
 
9
9
  def expired?: () -> bool
10
10
 
11
- def self.convert: (IPAddr | _ToS address) -> Resolver::Entry
11
+ def self.convert: (ipaddr address) -> Resolver::Entry
12
12
  end
13
13
  end
data/sig/response.rbs CHANGED
@@ -60,8 +60,7 @@ module HTTPX
60
60
  end
61
61
 
62
62
  class ContentType
63
- MIME_TYPE_RE: Regexp
64
- CHARSET_RE: Regexp
63
+ SPLIT_PATTERN: Regexp
65
64
 
66
65
  @header_value: String?
67
66
  @mime_type: String?
data/sig/selector.rbs CHANGED
@@ -44,9 +44,9 @@ module HTTPX
44
44
 
45
45
  def next_tick: () -> void
46
46
 
47
- def terminate: () -> void
47
+ def terminate: (?Array[selectable]) -> void
48
48
 
49
- def find_resolver: (Options options) -> Resolver::Resolver?
49
+ def find_resolver: (Options options) -> resolver?
50
50
 
51
51
  def find_connection: (http_uri request_uri, Options options) -> Connection?
52
52
 
data/sig/session.rbs CHANGED
@@ -15,8 +15,6 @@ module HTTPX
15
15
  @wrapped: bool
16
16
  @closing: bool
17
17
 
18
- type resolver = Resolver::Multi | Resolver::Resolver
19
-
20
18
  def wrap: () { (instance) -> void } -> void
21
19
 
22
20
  def close: (?Selector selector) -> void
@@ -42,15 +40,19 @@ module HTTPX
42
40
  def initialize: (?options) { (self) -> void } -> void
43
41
  | (?options) -> void
44
42
 
45
- def selector_close: (Selector close) -> void
43
+ def can_checkin?: (Connection connection) -> boolish
44
+
45
+ def selector_close: (Selector close, *untyped) -> void
46
46
 
47
- def deactivate: (Selector selector) -> void
47
+ def deactivate: (Selector selector, ?Exception? error) -> void
48
48
 
49
49
  def on_promise: (untyped, untyped) -> void
50
50
 
51
51
  def fetch_response: (Request request, Selector selector, Options options) -> response?
52
52
 
53
- def send_request: (Request request, Selector selector, ?Options options) -> void
53
+ def send_request: (Request request, Selector selector, ?Options options) ?{ (Connection) -> void } -> void
54
+
55
+ def do_request: (Request request, Connection connection, Selector selector) -> void
54
56
 
55
57
  def set_request_callbacks: (Request request) -> void
56
58
 
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
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -173,6 +173,7 @@ extra_rdoc_files:
173
173
  - doc/release_notes/1_8_2.md
174
174
  - doc/release_notes/1_8_3.md
175
175
  - doc/release_notes/1_8_4.md
176
+ - doc/release_notes/1_9_0.md
176
177
  files:
177
178
  - LICENSE.txt
178
179
  - README.md
@@ -318,6 +319,7 @@ files:
318
319
  - doc/release_notes/1_8_2.md
319
320
  - doc/release_notes/1_8_3.md
320
321
  - doc/release_notes/1_8_4.md
322
+ - doc/release_notes/1_9_0.md
321
323
  - lib/httpx.rb
322
324
  - lib/httpx/adapters/datadog.rb
323
325
  - lib/httpx/adapters/faraday.rb
@@ -373,6 +375,7 @@ files:
373
375
  - lib/httpx/plugins/grpc/grpc_encoding.rb
374
376
  - lib/httpx/plugins/grpc/message.rb
375
377
  - lib/httpx/plugins/h2c.rb
378
+ - lib/httpx/plugins/hedging.rb
376
379
  - lib/httpx/plugins/internal_telemetry.rb
377
380
  - lib/httpx/plugins/ntlm_auth.rb
378
381
  - lib/httpx/plugins/ntlm_v2_auth.rb
@@ -484,6 +487,7 @@ files:
484
487
  - sig/plugins/grpc/grpc_encoding.rbs
485
488
  - sig/plugins/grpc/message.rbs
486
489
  - sig/plugins/h2c.rbs
490
+ - sig/plugins/hedging.rbs
487
491
  - sig/plugins/ntlm_auth.rbs
488
492
  - sig/plugins/ntlm_v2_auth.rbs
489
493
  - sig/plugins/oauth.rbs