httpx 1.7.2 → 1.7.6

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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/doc/release_notes/1_7_3.md +29 -0
  4. data/doc/release_notes/1_7_4.md +42 -0
  5. data/doc/release_notes/1_7_5.md +10 -0
  6. data/doc/release_notes/1_7_6.md +24 -0
  7. data/lib/httpx/adapters/datadog.rb +37 -64
  8. data/lib/httpx/adapters/webmock.rb +3 -4
  9. data/lib/httpx/altsvc.rb +4 -2
  10. data/lib/httpx/connection/http1.rb +26 -18
  11. data/lib/httpx/connection/http2.rb +53 -33
  12. data/lib/httpx/connection.rb +152 -63
  13. data/lib/httpx/io/ssl.rb +20 -8
  14. data/lib/httpx/io/tcp.rb +18 -12
  15. data/lib/httpx/io/unix.rb +13 -9
  16. data/lib/httpx/options.rb +23 -7
  17. data/lib/httpx/parser/http1.rb +14 -4
  18. data/lib/httpx/plugins/auth/digest.rb +2 -1
  19. data/lib/httpx/plugins/auth.rb +23 -9
  20. data/lib/httpx/plugins/brotli.rb +33 -5
  21. data/lib/httpx/plugins/cookies/cookie.rb +34 -11
  22. data/lib/httpx/plugins/cookies/jar.rb +93 -18
  23. data/lib/httpx/plugins/cookies.rb +7 -3
  24. data/lib/httpx/plugins/expect.rb +33 -3
  25. data/lib/httpx/plugins/fiber_concurrency.rb +2 -4
  26. data/lib/httpx/plugins/follow_redirects.rb +7 -1
  27. data/lib/httpx/plugins/h2c.rb +1 -1
  28. data/lib/httpx/plugins/proxy/http.rb +15 -8
  29. data/lib/httpx/plugins/proxy.rb +10 -2
  30. data/lib/httpx/plugins/rate_limiter.rb +19 -19
  31. data/lib/httpx/plugins/retries.rb +17 -9
  32. data/lib/httpx/plugins/ssrf_filter.rb +1 -0
  33. data/lib/httpx/plugins/stream_bidi.rb +6 -0
  34. data/lib/httpx/plugins/tracing.rb +137 -0
  35. data/lib/httpx/pool.rb +7 -9
  36. data/lib/httpx/request.rb +15 -3
  37. data/lib/httpx/resolver/multi.rb +1 -8
  38. data/lib/httpx/resolver/native.rb +2 -2
  39. data/lib/httpx/resolver/resolver.rb +21 -2
  40. data/lib/httpx/resolver/system.rb +3 -1
  41. data/lib/httpx/response.rb +5 -1
  42. data/lib/httpx/selector.rb +19 -16
  43. data/lib/httpx/session.rb +34 -44
  44. data/lib/httpx/timers.rb +4 -0
  45. data/lib/httpx/version.rb +1 -1
  46. data/sig/altsvc.rbs +2 -0
  47. data/sig/chainable.rbs +2 -1
  48. data/sig/connection/http1.rbs +3 -1
  49. data/sig/connection/http2.rbs +11 -4
  50. data/sig/connection.rbs +16 -2
  51. data/sig/io/ssl.rbs +1 -0
  52. data/sig/io/tcp.rbs +2 -2
  53. data/sig/options.rbs +8 -3
  54. data/sig/parser/http1.rbs +1 -1
  55. data/sig/plugins/auth.rbs +5 -2
  56. data/sig/plugins/brotli.rbs +11 -6
  57. data/sig/plugins/cookies/cookie.rbs +3 -2
  58. data/sig/plugins/cookies/jar.rbs +11 -0
  59. data/sig/plugins/cookies.rbs +2 -0
  60. data/sig/plugins/expect.rbs +21 -2
  61. data/sig/plugins/fiber_concurrency.rbs +2 -2
  62. data/sig/plugins/proxy/socks4.rbs +4 -0
  63. data/sig/plugins/rate_limiter.rbs +2 -2
  64. data/sig/plugins/response_cache.rbs +3 -3
  65. data/sig/plugins/retries.rbs +17 -13
  66. data/sig/plugins/tracing.rbs +41 -0
  67. data/sig/pool.rbs +1 -1
  68. data/sig/request.rbs +4 -0
  69. data/sig/resolver/native.rbs +2 -0
  70. data/sig/resolver/resolver.rbs +4 -2
  71. data/sig/resolver/system.rbs +0 -2
  72. data/sig/response/body.rbs +1 -1
  73. data/sig/selector.rbs +7 -2
  74. data/sig/session.rbs +2 -0
  75. data/sig/timers.rbs +2 -0
  76. data/sig/transcoder/gzip.rbs +1 -1
  77. data/sig/transcoder.rbs +0 -2
  78. metadata +13 -3
@@ -0,0 +1,41 @@
1
+ module HTTPX
2
+ module Plugins
3
+ module Tracing
4
+ interface _Tracer
5
+ def enabled?: (retriesRequest request) -> boolish
6
+
7
+ def start: (retriesRequest request) -> void
8
+
9
+ def reset: (retriesRequest request) -> void
10
+
11
+ def finish: (retriesRequest request, response response) -> void
12
+ end
13
+
14
+ class Wrapper
15
+ include _Tracer
16
+
17
+ attr_reader tracers: Array[_Tracer]
18
+
19
+ def initialize: (*_Tracer tracers) -> void
20
+
21
+ def merge: (instance | _Tracer) -> void
22
+ end
23
+
24
+ interface _RetriesOptions
25
+ def tracer: () -> _Tracer
26
+ end
27
+
28
+ module RequestMethods
29
+ attr_accessor init_time: Time?
30
+ end
31
+
32
+ module ConnectionMethods
33
+ @init_time: Time
34
+ end
35
+
36
+ type retriesRequest = Request & RequestMethods
37
+ end
38
+
39
+ type sessionTracing = Session
40
+ end
41
+ end
data/sig/pool.rbs CHANGED
@@ -34,7 +34,7 @@ module HTTPX
34
34
 
35
35
  def checkout_resolver: (Options options) -> resolver_manager
36
36
 
37
- def checkin_resolver: (Resolver::Resolver resolver) -> void
37
+ def checkin_resolver: (Resolver::Multi | Resolver::Resolver resolver) -> void
38
38
 
39
39
  private
40
40
 
data/sig/request.rbs CHANGED
@@ -6,6 +6,7 @@ module HTTPX
6
6
 
7
7
  METHODS: Array[Symbol]
8
8
  USER_AGENT: String
9
+ ALLOWED_URI_SCHEMES: Array[String]
9
10
 
10
11
  attr_reader verb: verb
11
12
  attr_reader uri: http_uri
@@ -17,6 +18,7 @@ module HTTPX
17
18
  attr_reader drain_error: StandardError?
18
19
  attr_reader active_timeouts: Array[Symbol]
19
20
 
21
+ attr_writer connection: Connection?
20
22
  attr_accessor peer_address: (String | IPAddr)?
21
23
 
22
24
  attr_writer persistent: bool
@@ -80,6 +82,8 @@ module HTTPX
80
82
 
81
83
  def set_timeout_callback: (Symbol event) { (*untyped) -> void } -> void
82
84
 
85
+ def handle_error: (StandardError error) -> void
86
+
83
87
  private
84
88
 
85
89
  def initialize_body: (Options options) -> Transcoder::_Encoder?
@@ -37,6 +37,8 @@ module HTTPX
37
37
 
38
38
  def handle_socket_timeout: (Numeric interval) -> void
39
39
 
40
+ def on_io_error: (IOError error) -> void
41
+
40
42
  private
41
43
 
42
44
  def initialize: (ip_family family, options options) -> void
@@ -27,8 +27,6 @@ module HTTPX
27
27
 
28
28
  def terminate: () -> void
29
29
 
30
- def force_close: (*untyped args) -> void
31
-
32
30
  def closed?: () -> bool
33
31
 
34
32
  def empty?: () -> bool
@@ -43,6 +41,8 @@ module HTTPX
43
41
 
44
42
  def early_resolve: (Connection connection, ?hostname: String) -> bool
45
43
 
44
+ def lazy_resolve: (Connection connection) -> void
45
+
46
46
  private
47
47
 
48
48
  def resolve: (?Connection connection, ?String hostname) -> void
@@ -60,6 +60,8 @@ module HTTPX
60
60
  def resolve_error: (String hostname, ?StandardError?) -> (ResolveError | ResolveTimeoutError)
61
61
 
62
62
  def close_or_resolve: () -> void
63
+
64
+ def disconnect: () -> void
63
65
  end
64
66
  end
65
67
  end
@@ -18,8 +18,6 @@ module HTTPX
18
18
 
19
19
  def initialize: (Options options) -> void
20
20
 
21
- def lazy_resolve: (Connection connection) -> void
22
-
23
21
  private
24
22
 
25
23
  def transition: (Symbol nextstate) -> void
@@ -43,7 +43,7 @@ module HTTPX
43
43
 
44
44
  def initialize_inflaters: () -> void
45
45
 
46
- def self.initialize_inflater_by_encoding: (Encoding | String encoding, Response response, ?bytesize: Integer) -> Transcoder::GZIP::Inflater
46
+ def self.initialize_inflater_by_encoding: (Encoding | String encoding, Response response, ?bytesize: Integer) -> (Object & Transcoder::_Inflater)
47
47
 
48
48
  def decode_chunk: (String chunk) -> String
49
49
 
data/sig/selector.rbs CHANGED
@@ -13,6 +13,10 @@ module HTTPX
13
13
  def handle_socket_timeout: (Numeric interval) -> void
14
14
 
15
15
  def on_error: (StandardError) -> void
16
+
17
+ def on_io_error: (IOError error) -> void
18
+
19
+ def force_close: (?bool delete_pending) -> void
16
20
  end
17
21
 
18
22
  class Selector
@@ -20,8 +24,6 @@ module HTTPX
20
24
 
21
25
  type io_select_selectable = (selectable | Array[selectable])?
22
26
 
23
- include _Each[selectable]
24
-
25
27
  extend Forwardable
26
28
 
27
29
  READABLE: Array[io_interests]
@@ -32,6 +34,9 @@ module HTTPX
32
34
  @selectables: Array[selectable]
33
35
  @is_timer_interval: bool
34
36
 
37
+ def each: () -> ::Enumerator[selectable, self]
38
+ | () { (selectable) -> void } -> self
39
+
35
40
  def next_tick: () -> void
36
41
 
37
42
  def terminate: () -> void
data/sig/session.rbs CHANGED
@@ -66,6 +66,8 @@ module HTTPX
66
66
 
67
67
  def receive_requests: (Array[Request] requests, Selector selector) -> Array[response]
68
68
 
69
+ def early_resolve: (resolver resolver, Connection connection) -> bool
70
+
69
71
  def resolve_connection: (Connection connection, Selector selector) -> void
70
72
 
71
73
  def on_resolver_connection: (Connection connection, Selector selector) -> void
data/sig/timers.rbs CHANGED
@@ -14,6 +14,8 @@ module HTTPX
14
14
 
15
15
  def initialize: () -> void
16
16
 
17
+ def empty?: () -> bool
18
+
17
19
  private
18
20
 
19
21
  def drop_elapsed!: (Numeric elapsed_time) -> void
@@ -16,7 +16,7 @@ module HTTPX
16
16
 
17
17
  class Inflater
18
18
  @inflater: Zlib::Inflate
19
- @bytesize: Integer
19
+ @bytesize: Integer | Float
20
20
 
21
21
  def initialize: (Integer | Float bytesize) -> void
22
22
 
data/sig/transcoder.rbs CHANGED
@@ -31,8 +31,6 @@ module HTTPX
31
31
  end
32
32
 
33
33
  interface _Inflater
34
- def initialize: (Integer | Float bytesize) -> void
35
-
36
34
  def call: (String chunk) -> String
37
35
  end
38
36
 
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.7.2
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 1.0.0
18
+ version: 1.1.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 1.0.0
25
+ version: 1.1.3
26
26
  description: A client library for making HTTP requests from Ruby.
27
27
  email:
28
28
  - cardoso_tiago@hotmail.com
@@ -162,6 +162,10 @@ extra_rdoc_files:
162
162
  - doc/release_notes/1_7_0.md
163
163
  - doc/release_notes/1_7_1.md
164
164
  - doc/release_notes/1_7_2.md
165
+ - doc/release_notes/1_7_3.md
166
+ - doc/release_notes/1_7_4.md
167
+ - doc/release_notes/1_7_5.md
168
+ - doc/release_notes/1_7_6.md
165
169
  files:
166
170
  - LICENSE.txt
167
171
  - README.md
@@ -296,6 +300,10 @@ files:
296
300
  - doc/release_notes/1_7_0.md
297
301
  - doc/release_notes/1_7_1.md
298
302
  - doc/release_notes/1_7_2.md
303
+ - doc/release_notes/1_7_3.md
304
+ - doc/release_notes/1_7_4.md
305
+ - doc/release_notes/1_7_5.md
306
+ - doc/release_notes/1_7_6.md
299
307
  - lib/httpx.rb
300
308
  - lib/httpx/adapters/datadog.rb
301
309
  - lib/httpx/adapters/faraday.rb
@@ -367,6 +375,7 @@ files:
367
375
  - lib/httpx/plugins/ssrf_filter.rb
368
376
  - lib/httpx/plugins/stream.rb
369
377
  - lib/httpx/plugins/stream_bidi.rb
378
+ - lib/httpx/plugins/tracing.rb
370
379
  - lib/httpx/plugins/upgrade.rb
371
380
  - lib/httpx/plugins/upgrade/h2.rb
372
381
  - lib/httpx/plugins/webdav.rb
@@ -472,6 +481,7 @@ files:
472
481
  - sig/plugins/ssrf_filter.rbs
473
482
  - sig/plugins/stream.rbs
474
483
  - sig/plugins/stream_bidi.rbs
484
+ - sig/plugins/tracing.rbs
475
485
  - sig/plugins/upgrade.rbs
476
486
  - sig/plugins/upgrade/h2.rbs
477
487
  - sig/plugins/webdav.rbs