httpx 1.7.2 → 1.7.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.
Files changed (57) 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/lib/httpx/adapters/datadog.rb +24 -60
  6. data/lib/httpx/adapters/webmock.rb +3 -4
  7. data/lib/httpx/connection/http1.rb +6 -1
  8. data/lib/httpx/connection/http2.rb +43 -30
  9. data/lib/httpx/connection.rb +74 -22
  10. data/lib/httpx/plugins/auth/digest.rb +2 -1
  11. data/lib/httpx/plugins/brotli.rb +33 -5
  12. data/lib/httpx/plugins/cookies/cookie.rb +34 -11
  13. data/lib/httpx/plugins/cookies/jar.rb +93 -18
  14. data/lib/httpx/plugins/cookies.rb +7 -3
  15. data/lib/httpx/plugins/expect.rb +30 -3
  16. data/lib/httpx/plugins/fiber_concurrency.rb +2 -4
  17. data/lib/httpx/plugins/follow_redirects.rb +7 -1
  18. data/lib/httpx/plugins/h2c.rb +1 -1
  19. data/lib/httpx/plugins/proxy/http.rb +15 -8
  20. data/lib/httpx/plugins/proxy.rb +10 -2
  21. data/lib/httpx/plugins/rate_limiter.rb +19 -19
  22. data/lib/httpx/plugins/retries.rb +17 -9
  23. data/lib/httpx/plugins/ssrf_filter.rb +1 -0
  24. data/lib/httpx/plugins/stream_bidi.rb +6 -0
  25. data/lib/httpx/plugins/tracing.rb +137 -0
  26. data/lib/httpx/request.rb +1 -1
  27. data/lib/httpx/resolver/multi.rb +1 -8
  28. data/lib/httpx/resolver/native.rb +1 -1
  29. data/lib/httpx/resolver/resolver.rb +21 -2
  30. data/lib/httpx/resolver/system.rb +3 -1
  31. data/lib/httpx/selector.rb +4 -4
  32. data/lib/httpx/session.rb +11 -6
  33. data/lib/httpx/version.rb +1 -1
  34. data/sig/chainable.rbs +2 -1
  35. data/sig/connection/http1.rbs +2 -0
  36. data/sig/connection/http2.rbs +11 -4
  37. data/sig/connection.rbs +7 -0
  38. data/sig/plugins/brotli.rbs +11 -6
  39. data/sig/plugins/cookies/cookie.rbs +3 -2
  40. data/sig/plugins/cookies/jar.rbs +11 -0
  41. data/sig/plugins/cookies.rbs +2 -0
  42. data/sig/plugins/expect.rbs +17 -2
  43. data/sig/plugins/proxy/socks4.rbs +4 -0
  44. data/sig/plugins/rate_limiter.rbs +2 -2
  45. data/sig/plugins/response_cache.rbs +3 -3
  46. data/sig/plugins/retries.rbs +17 -13
  47. data/sig/plugins/tracing.rbs +41 -0
  48. data/sig/request.rbs +1 -0
  49. data/sig/resolver/native.rbs +2 -0
  50. data/sig/resolver/resolver.rbs +4 -2
  51. data/sig/resolver/system.rbs +0 -2
  52. data/sig/response/body.rbs +1 -1
  53. data/sig/selector.rbs +4 -0
  54. data/sig/session.rbs +2 -0
  55. data/sig/transcoder/gzip.rbs +1 -1
  56. data/sig/transcoder.rbs +0 -2
  57. metadata +9 -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/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
@@ -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
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
@@ -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.4
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,8 @@ 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
165
167
  files:
166
168
  - LICENSE.txt
167
169
  - README.md
@@ -296,6 +298,8 @@ files:
296
298
  - doc/release_notes/1_7_0.md
297
299
  - doc/release_notes/1_7_1.md
298
300
  - doc/release_notes/1_7_2.md
301
+ - doc/release_notes/1_7_3.md
302
+ - doc/release_notes/1_7_4.md
299
303
  - lib/httpx.rb
300
304
  - lib/httpx/adapters/datadog.rb
301
305
  - lib/httpx/adapters/faraday.rb
@@ -367,6 +371,7 @@ files:
367
371
  - lib/httpx/plugins/ssrf_filter.rb
368
372
  - lib/httpx/plugins/stream.rb
369
373
  - lib/httpx/plugins/stream_bidi.rb
374
+ - lib/httpx/plugins/tracing.rb
370
375
  - lib/httpx/plugins/upgrade.rb
371
376
  - lib/httpx/plugins/upgrade/h2.rb
372
377
  - lib/httpx/plugins/webdav.rb
@@ -472,6 +477,7 @@ files:
472
477
  - sig/plugins/ssrf_filter.rbs
473
478
  - sig/plugins/stream.rbs
474
479
  - sig/plugins/stream_bidi.rbs
480
+ - sig/plugins/tracing.rbs
475
481
  - sig/plugins/upgrade.rbs
476
482
  - sig/plugins/upgrade/h2.rbs
477
483
  - sig/plugins/webdav.rbs