httpx 1.6.3 → 1.7.1

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/0_11_0.md +3 -3
  3. data/doc/release_notes/1_6_3.md +2 -2
  4. data/doc/release_notes/1_7_0.md +149 -0
  5. data/doc/release_notes/1_7_1.md +21 -0
  6. data/lib/httpx/adapters/datadog.rb +1 -1
  7. data/lib/httpx/adapters/faraday.rb +1 -1
  8. data/lib/httpx/adapters/webmock.rb +18 -9
  9. data/lib/httpx/altsvc.rb +4 -2
  10. data/lib/httpx/connection/http1.rb +9 -9
  11. data/lib/httpx/connection/http2.rb +2 -0
  12. data/lib/httpx/connection.rb +7 -9
  13. data/lib/httpx/domain_name.rb +1 -1
  14. data/lib/httpx/headers.rb +2 -2
  15. data/lib/httpx/io/tcp.rb +1 -1
  16. data/lib/httpx/loggable.rb +2 -0
  17. data/lib/httpx/options.rb +118 -22
  18. data/lib/httpx/parser/http1.rb +1 -0
  19. data/lib/httpx/plugins/auth/digest.rb +44 -4
  20. data/lib/httpx/plugins/auth.rb +113 -4
  21. data/lib/httpx/plugins/aws_sdk_authentication.rb +0 -1
  22. data/lib/httpx/plugins/cookies/cookie.rb +1 -0
  23. data/lib/httpx/plugins/digest_auth.rb +4 -5
  24. data/lib/httpx/plugins/fiber_concurrency.rb +16 -1
  25. data/lib/httpx/plugins/grpc/grpc_encoding.rb +1 -1
  26. data/lib/httpx/plugins/grpc.rb +2 -2
  27. data/lib/httpx/plugins/internal_telemetry.rb +1 -1
  28. data/lib/httpx/plugins/ntlm_auth.rb +5 -3
  29. data/lib/httpx/plugins/oauth.rb +156 -57
  30. data/lib/httpx/plugins/persistent.rb +3 -5
  31. data/lib/httpx/plugins/proxy/http.rb +0 -4
  32. data/lib/httpx/plugins/proxy.rb +3 -1
  33. data/lib/httpx/plugins/query.rb +1 -1
  34. data/lib/httpx/plugins/rate_limiter.rb +20 -15
  35. data/lib/httpx/plugins/response_cache.rb +3 -7
  36. data/lib/httpx/plugins/retries.rb +60 -24
  37. data/lib/httpx/plugins/ssrf_filter.rb +1 -1
  38. data/lib/httpx/plugins/stream.rb +60 -9
  39. data/lib/httpx/plugins/stream_bidi.rb +84 -16
  40. data/lib/httpx/pool.rb +12 -3
  41. data/lib/httpx/request/body.rb +1 -1
  42. data/lib/httpx/request.rb +10 -1
  43. data/lib/httpx/resolver/cache/base.rb +136 -0
  44. data/lib/httpx/resolver/cache/memory.rb +42 -0
  45. data/lib/httpx/resolver/cache.rb +18 -0
  46. data/lib/httpx/resolver/https.rb +74 -20
  47. data/lib/httpx/resolver/multi.rb +10 -2
  48. data/lib/httpx/resolver/native.rb +32 -6
  49. data/lib/httpx/resolver/resolver.rb +3 -3
  50. data/lib/httpx/resolver.rb +36 -114
  51. data/lib/httpx/response/body.rb +5 -3
  52. data/lib/httpx/response.rb +22 -6
  53. data/lib/httpx/selector.rb +14 -3
  54. data/lib/httpx/session.rb +6 -6
  55. data/lib/httpx/timers.rb +6 -12
  56. data/lib/httpx/transcoder/body.rb +1 -1
  57. data/lib/httpx/transcoder/gzip.rb +7 -2
  58. data/lib/httpx/transcoder/json.rb +1 -1
  59. data/lib/httpx/transcoder/multipart/decoder.rb +5 -5
  60. data/lib/httpx/transcoder/multipart/encoder.rb +1 -1
  61. data/lib/httpx/transcoder/multipart.rb +17 -9
  62. data/lib/httpx/transcoder.rb +4 -6
  63. data/lib/httpx/utils.rb +13 -0
  64. data/lib/httpx/version.rb +1 -1
  65. data/sig/altsvc.rbs +9 -3
  66. data/sig/chainable.rbs +3 -3
  67. data/sig/connection.rbs +1 -3
  68. data/sig/loggable.rbs +1 -1
  69. data/sig/options.rbs +12 -4
  70. data/sig/plugins/auth/digest.rbs +6 -0
  71. data/sig/plugins/auth.rbs +37 -4
  72. data/sig/plugins/basic_auth.rbs +3 -3
  73. data/sig/plugins/digest_auth.rbs +2 -4
  74. data/sig/plugins/fiber_concurrency.rbs +6 -0
  75. data/sig/plugins/ntlm_auth.rbs +2 -2
  76. data/sig/plugins/oauth.rbs +44 -15
  77. data/sig/plugins/rate_limiter.rbs +4 -2
  78. data/sig/plugins/response_cache/file_store.rbs +2 -0
  79. data/sig/plugins/response_cache.rbs +4 -0
  80. data/sig/plugins/retries.rbs +12 -4
  81. data/sig/plugins/stream.rbs +13 -3
  82. data/sig/plugins/stream_bidi.rbs +2 -2
  83. data/sig/pool.rbs +1 -1
  84. data/sig/resolver/cache/base.rbs +28 -0
  85. data/sig/resolver/cache/memory.rbs +13 -0
  86. data/sig/resolver/cache.rbs +16 -0
  87. data/sig/resolver/https.rbs +24 -0
  88. data/sig/resolver/multi.rbs +8 -0
  89. data/sig/resolver/native.rbs +2 -0
  90. data/sig/resolver.rbs +5 -20
  91. data/sig/response.rbs +3 -0
  92. data/sig/session.rbs +3 -5
  93. data/sig/timers.rbs +1 -1
  94. data/sig/transcoder/multipart.rbs +4 -2
  95. data/sig/transcoder.rbs +5 -1
  96. data/sig/utils.rbs +2 -0
  97. metadata +11 -1
@@ -15,19 +15,18 @@ module HTTPX
15
15
  SUPPORTED_AUTH_METHODS: ::Array[token_auth_method]
16
16
 
17
17
  class OAuthSession
18
- attr_reader grant_type: grant_type
19
-
20
- attr_reader client_id: String
21
-
22
- attr_reader client_secret: String
23
-
24
18
  attr_reader access_token: String?
25
19
 
26
20
  attr_reader refresh_token: String?
27
21
 
28
- attr_reader scope: Array[String]?
29
-
30
- attr_reader audience: String?
22
+ @issuer: http_uri
23
+ @grant_type: grant_type
24
+ @client_id: String
25
+ @client_secret: String
26
+ @token_endpoint: http_uri?
27
+ @scope: Array[String]?
28
+ @audience: String?
29
+ @token_endpoint_auth_method: String?
31
30
 
32
31
  def initialize: (
33
32
  issuer: uri,
@@ -37,32 +36,62 @@ module HTTPX
37
36
  ?refresh_token: String?,
38
37
  ?scope: (Array[String] | String)?,
39
38
  ?token_endpoint: String?,
40
- ?response_type: String?,
41
39
  ?grant_type: String?,
42
40
  ?token_endpoint_auth_method: ::String,
43
41
  ?audience: ::String
44
42
  ) -> void
45
43
 
46
- def token_endpoint: () -> String
44
+ def token_endpoint: () -> uri
45
+
46
+ def token_endpoint_auth_method: () -> String
47
47
 
48
- def token_endpoint_auth_method: () -> token_auth_method
48
+ def reset!: () -> void
49
49
 
50
- def load: (Session http) -> void
50
+ def fetch_access_token: (sessionOAuth http) -> String
51
51
 
52
52
  def merge: (instance | Hash[untyped, untyped] other) -> instance
53
+
54
+ private
55
+
56
+
57
+ def load: (sessionOAuth http) -> void
53
58
  end
54
59
 
55
- interface _AwsSdkOptions
60
+ interface _OAuthOptions
56
61
  def oauth_session: () -> OAuthSession?
62
+
63
+ def oauth_options: () -> {
64
+ issuer: uri,
65
+ client_id: String,
66
+ client_secret: String,
67
+ ?access_token: String?,
68
+ ?refresh_token: String?,
69
+ ?scope: (Array[String] | String)?,
70
+ ?token_endpoint: String?,
71
+ ?response_type: String?,
72
+ ?grant_type: String?,
73
+ ?token_endpoint_auth_method: ::String,
74
+ ?audience: ::String
75
+ }?
57
76
  end
58
77
 
59
78
  module InstanceMethods
79
+ attr_reader oauth_session: OAuthSession
80
+ @options: Options & _OAuthOptions
81
+
60
82
  def oauth_auth: (**untyped args) -> instance
61
83
 
62
84
  def with_access_token: () -> instance
85
+
86
+ def refresh_oauth_tokens!: () -> void
87
+ end
88
+
89
+ module OAuthRetries
90
+ module InstanceMethods
91
+ end
63
92
  end
64
93
  end
65
94
 
66
- type sessionOAuth = Session & OAuth::InstanceMethods
95
+ type sessionOAuth = Session & Auth::InstanceMethods & OAuth::InstanceMethods
67
96
  end
68
97
  end
@@ -5,9 +5,11 @@ module HTTPX
5
5
 
6
6
  def self.load_dependencies: (singleton(Session)) -> void
7
7
 
8
- def self.retry_on_rate_limited_response: (_Response) -> bool
9
-
10
8
  def self.retry_after_rate_limit: (untyped, response) -> Numeric?
9
+
10
+ module InstanceMethods
11
+ def rate_limit_error?: (response response) -> bool
12
+ end
11
13
  end
12
14
  end
13
15
  end
@@ -2,6 +2,8 @@ module HTTPX
2
2
  module Plugins
3
3
  module ResponseCache
4
4
  class FileStore
5
+ CRLF: String
6
+
5
7
  @dir: Pathname
6
8
 
7
9
  include _ResponseCacheStore
@@ -39,6 +39,7 @@ module HTTPX
39
39
 
40
40
  module RequestMethods
41
41
  attr_accessor cached_response: cacheResponse?
42
+ attr_reader options: cacheOptions
42
43
 
43
44
  @response_cache_key: String
44
45
 
@@ -51,6 +52,9 @@ module HTTPX
51
52
  attr_writer original_request: cacheRequest
52
53
 
53
54
  @cache: bool
55
+ @cache_control: Array[String]?
56
+ @vary: Array[String]?
57
+ @date: Time?
54
58
 
55
59
  def original_request: () -> cacheRequest?
56
60
 
@@ -6,13 +6,18 @@ module HTTPX
6
6
  RECONNECTABLE_ERRORS: Array[singleton(StandardError)]
7
7
  RETRYABLE_ERRORS: Array[singleton(StandardError)]
8
8
  DEFAULT_JITTER: ^(Numeric) -> Numeric
9
+ BACKOFF_ALGORITHMS: Array[Symbol]
10
+
11
+ def self?.retry_after_polynomial_backoff: (retriesRequest request, response response) -> Numeric
12
+
13
+ def self?.retry_after_exponential_backoff: (retriesRequest request, response response) -> Numeric
9
14
 
10
15
  interface _RetryCallback
11
16
  def call: (response response) -> bool?
12
17
  end
13
18
 
14
19
  interface _RetriesOptions
15
- def retry_after: () -> Numeric?
20
+ def retry_after: () -> (^(retriesRequest request, response response) -> Numeric | Numeric)?
16
21
 
17
22
  def retry_jitter: () -> ^(Numeric jitter) -> Numeric
18
23
 
@@ -32,16 +37,19 @@ module HTTPX
32
37
 
33
38
  def fetch_response: (retriesRequest request, Selector selector, retriesOptions options) -> (retriesResponse | ErrorResponse)?
34
39
 
35
- def repeatable_request?: (retriesRequest request, retriesOptions options) -> boolish
40
+ def retryable_request?: (retriesRequest request, response response, retriesOptions options) -> boolish
41
+
42
+ def retryable_response?: (response response, retriesOptions options) -> boolish
36
43
 
37
- def retryable_error?: (_Exception error) -> bool
44
+ def retryable_error?: (_Exception error, Options options) -> boolish
38
45
 
39
46
  def try_partial_retry: (retriesRequest request, (retriesResponse | ErrorResponse) response) -> void
40
47
 
48
+ def prepare_to_retry: (Request & RequestMethods request, response response) -> void
41
49
  end
42
50
 
43
51
  module RequestMethods
44
- @options: Options & _RetriesOptions
52
+ attr_reader options: retriesOptions
45
53
 
46
54
  attr_accessor retries: Integer
47
55
 
@@ -1,11 +1,21 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module Stream
4
+ STREAM_REQUEST_OPTIONS: Hash[Symbol, untyped]
5
+
6
+ interface _StreamOptions
7
+ def stream: () -> boolish
8
+
9
+ def retry_stream_response_class: () -> singleton(StreamResponse)
10
+ end
11
+
4
12
  module InstanceMethods
13
+ @options: Options & _StreamOptions
14
+
5
15
  private
6
16
 
7
- def request: (*Request, ?stream: bool, **untyped?) -> (response | Array[response] | StreamResponse)
8
- | (*untyped, ?stream: bool, **untyped?) -> (response | Array[response] | StreamResponse)
17
+ def request: (*Request, **untyped?) -> (response | Array[response] | StreamResponse)
18
+ | (*untyped, **untyped?) -> (response | Array[response] | StreamResponse)
9
19
  end
10
20
 
11
21
  module RequestMethods
@@ -30,7 +40,7 @@ module HTTPX
30
40
  type streamRequest = Request & Plugins::Stream::RequestMethods
31
41
 
32
42
  attr_reader request: streamRequest
33
- @options: Options
43
+ @options: Options & _StreamOptions
34
44
 
35
45
  @session: Plugins::sessionStream
36
46
  @response_enum: Enumerator[String]?
@@ -16,7 +16,7 @@ module HTTPX
16
16
  end
17
17
 
18
18
  class BidiBuffer < Buffer
19
- @parent_thread: Thread
19
+ @buffer_mutex: Thread::Mutex
20
20
  @oob_mutex: Thread::Mutex
21
21
  @oob_buffer: String
22
22
 
@@ -34,7 +34,7 @@ module HTTPX
34
34
 
35
35
  def wakeup: () -> void
36
36
 
37
- def mergeable?: () -> bool
37
+ def inflight?: () -> bool
38
38
 
39
39
  def terminate: () -> void
40
40
  end
data/sig/pool.rbs CHANGED
@@ -15,7 +15,7 @@ module HTTPX
15
15
  @options: Options
16
16
  @resolvers: Hash[Class, Array[resolver_manager]]
17
17
  @resolver_mtx: Thread::Mutex
18
- @connections: Hash[String, Array[Connection]]
18
+ @connections: Array[Connection]
19
19
  @connection_mtx: Thread::Mutex
20
20
  @connections_counter: Integer
21
21
  @max_connections_cond: ConditionVariable
@@ -0,0 +1,28 @@
1
+ module HTTPX
2
+ module Resolver
3
+ class Cache::Base
4
+ include _Cache
5
+
6
+ MAX_CACHE_SIZE: Integer
7
+
8
+ CACHE_MUTEX: Thread::Mutex
9
+ HOSTS: Resolv::Hosts
10
+
11
+ self.@cache: instance?
12
+
13
+ def self.cache: (Symbol label) -> instance
14
+
15
+ private
16
+
17
+ def ip_resolve: (String hostname) -> Array[Entry]?
18
+
19
+ def hosts_resolve: (String hostname) -> Array[Entry]?
20
+
21
+ def _get: (String hostname, Hash[String, Array[dns_result]] lookups, Array[String] hostnames, Numeric ttl) -> Array[Entry]?
22
+
23
+ def _set: (String hostname, ip_family family, Array[dns_result] entries, Hash[String, Array[dns_result]] lookups, Array[String] hostnames) -> void
24
+
25
+ def _evict: (String hostname, String ip, Hash[String, Array[dns_result]] lookups, Array[String] hostnames) -> void
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ module HTTPX::Resolver
2
+ module Cache
3
+ class Memory < Base
4
+ @lookup_mutex: Thread::Mutex
5
+ @hostnames: Array[String]
6
+ @lookups: Hash[String, Array[dns_result]]
7
+
8
+ private
9
+
10
+ def synchronize: [U] () { (Hash[String, Array[dns_result]] lookups, Array[String] hostnames) -> U } -> U
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ module HTTPX
2
+ module Resolver
3
+ module Cache
4
+ end
5
+
6
+ interface _Cache
7
+ def resolve: (String hostname) -> Array[Entry]?
8
+
9
+ def get: (String hostname) -> Array[Entry]?
10
+
11
+ def set: (String hostname, ip_family family, Array[dns_result] addresses) -> void
12
+
13
+ def evict: (String hostname, _ToS ip) -> void
14
+ end
15
+ end
16
+ end
@@ -11,11 +11,14 @@ module HTTPX
11
11
  attr_reader family: ip_family
12
12
 
13
13
  @options: Options
14
+ @_timeouts: Array[Numeric]
15
+ @timeouts: Hash[String, Array[Numeric]]
14
16
  @queries: Hash[String, Connection]
15
17
  @requests: Hash[Request, String]
16
18
  @connections: Array[Connection]
17
19
  @uri: http_uri
18
20
  @uri_addresses: Array[String]?
21
+ @name: String?
19
22
  @resolver: Resolv::DNS
20
23
  @resolver_connection: Connection
21
24
 
@@ -23,12 +26,33 @@ module HTTPX
23
26
 
24
27
  def <<: (Connection) -> void
25
28
 
29
+ # delegated to resolver connection
30
+ def connecting?: () -> bool
31
+
32
+ def to_io: () -> IO
33
+
34
+ def call: () -> void
35
+
36
+ def close: () -> void
37
+
38
+ # def closed?: () -> bool
39
+
40
+ def deactivate: () -> void
41
+
42
+ def terminate: () -> void
43
+
44
+ def inflight?: () -> bool
45
+
46
+ def handle_socket_timeout: (Numeric interval) -> void
47
+
26
48
  private
27
49
 
28
50
  def initialize: (ip_family family, options options) -> void
29
51
 
30
52
  def resolver_connection: () -> Connection
31
53
 
54
+ def send_request: (String hostname, Connection connection) -> void
55
+
32
56
  def on_response: (Request, response) -> void
33
57
 
34
58
  def parse: (Request request, Response response) -> void
@@ -9,6 +9,8 @@ module HTTPX
9
9
  @current_session: Session?
10
10
  @resolver_options: Hash[Symbol, untyped]
11
11
 
12
+ def state: () -> String
13
+
12
14
  def current_selector=: (Selector s) -> void
13
15
 
14
16
  def current_session=: (Session s) -> void
@@ -18,6 +20,12 @@ module HTTPX
18
20
  def early_resolve: (Connection connection) -> bool
19
21
 
20
22
  def lazy_resolve: (Connection connection) -> void
23
+
24
+ private
25
+
26
+ def nolookup_resolve: (String hostname, Options options) -> Array[Entry]?
27
+
28
+ def initialize: (singleton(Native) | singleton(HTTPS) resolver_type, Options options) -> void
21
29
  end
22
30
  end
23
31
  end
@@ -64,6 +64,8 @@ module HTTPX
64
64
 
65
65
  def transition: (Symbol nextstate) -> void
66
66
 
67
+ def reset_query: () -> void
68
+
67
69
  def reset_hostname: (String hostname, ?connection: Connection, ?reset_candidates: bool) -> void
68
70
 
69
71
  def close_or_resolve: () -> void
data/sig/resolver.rbs CHANGED
@@ -9,40 +9,25 @@ module HTTPX
9
9
 
10
10
  RESOLVE_TIMEOUT: Array[Integer]
11
11
 
12
- self.@lookup_mutex: Thread::Mutex
13
- self.@lookups: Hash[String, Array[dns_result]]
14
12
  self.@identifier_mutex: Thread::Mutex
15
13
  self.@identifier: Integer
16
14
  self.@hosts_resolver: Resolv::Hosts
15
+ self.@supported_ip_families: Array[Integer]
17
16
 
18
- type dns_decoding_response = [:ok, Array[dns_result]] | [:decode_error, Resolv::DNS::DecodeError] | [:dns_error, Integer] | Symbol
19
-
20
- def self?.nolookup_resolve: (String hostname) -> Array[Entry]?
21
-
22
- def self?.ip_resolve: (String hostname) -> Array[Entry]?
23
-
24
- def self?.hosts_resolve: (String hostname) -> Array[Entry]?
17
+ type dns_decoding_response = [:ok, Array[dns_result]] | [:decode_error, Resolv::DNS::DecodeError] | [:retriable_error | :dns_error, Integer] | Symbol
25
18
 
26
19
  def self?.supported_ip_families: () -> Array[ip_family]
27
20
 
28
- def self?.resolver_for: (Symbol | singleton(Resolver) resolver_type, Options options) -> singleton(Resolver)
29
-
30
- def self?.cached_lookup: (String hostname) -> Array[Entry]?
31
-
32
- def self?.cached_lookup_set: (String hostname, ip_family family, Array[dns_result] addresses) -> void
33
-
34
- def self?.cached_lookup_evict: (String hostname, _ToS ip) -> void
35
-
36
- def self?.lookup: (String hostname, Hash[String, Array[dns_result]] lookups, Numeric ttl) -> Array[Entry]?
37
-
38
21
  def self?.generate_id: () -> Integer
39
22
 
40
23
  def self?.encode_dns_query: (String hostname, ?type: dns_resource, ?message_id: Integer) -> String
41
24
 
42
25
  def self?.decode_dns_answer: (String) -> dns_decoding_response
43
26
 
44
- def self?.lookup_synchronize: [U] () { (Hash[String, Array[dns_result]] lookups) -> U } -> U
27
+ private
45
28
 
46
29
  def self?.id_synchronize: () { () -> void } -> void
30
+
31
+ def find_supported_ip_families: () -> Array[Integer]
47
32
  end
48
33
  end
data/sig/response.rbs CHANGED
@@ -63,6 +63,7 @@ module HTTPX
63
63
  @header_value: String?
64
64
  @mime_type: String?
65
65
  @charset: String?
66
+ @initialized: bool
66
67
 
67
68
  def mime_type: () -> String?
68
69
 
@@ -71,6 +72,8 @@ module HTTPX
71
72
  private
72
73
 
73
74
  def initialize: (String? header_value) -> void
75
+
76
+ def load: () -> void
74
77
  end
75
78
 
76
79
  class ErrorResponse
data/sig/session.rbs CHANGED
@@ -55,10 +55,8 @@ module HTTPX
55
55
  def set_request_callbacks: (Request request) -> void
56
56
 
57
57
  def build_requests: (verb, uri, request_params) -> Array[Request]
58
- | (Array[[verb, uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
59
- | (Array[[verb, uri]], request_params) -> Array[Request]
60
- | (verb, _Each[[uri, request_params]], Hash[Symbol, untyped]) -> Array[Request]
61
- | (verb, _Each[uri], request_params) -> Array[Request]
58
+ | (Array[[verb, uri] | [verb, uri, request_params]], ?request_params) -> Array[Request]
59
+ | (verb, _Each[[uri] | [uri, request_params]], request_params) -> Array[Request]
62
60
 
63
61
  def do_init_connection: (Connection connection, Selector selector) -> void
64
62
 
@@ -76,7 +74,7 @@ module HTTPX
76
74
 
77
75
  def find_resolver_for: (Connection connection, Selector selector) -> resolver
78
76
 
79
- def coalesce_connections: (Connection conn1, Connection conn2, Selector selector, bool from_pool) -> bool
77
+ def coalesce_connections: (Connection conn1, Connection conn2, Selector selector, bool from_pool) -> void
80
78
 
81
79
  def get_current_selector: () -> Selector?
82
80
  | () { () -> Selector } -> Selector
data/sig/timers.rbs CHANGED
@@ -16,7 +16,7 @@ module HTTPX
16
16
 
17
17
  private
18
18
 
19
- def drop_elapsed!: (?Numeric elapsed_time) -> void
19
+ def drop_elapsed!: (Numeric elapsed_time) -> void
20
20
 
21
21
  class Interval
22
22
  include Comparable
@@ -7,8 +7,6 @@ module HTTPX
7
7
  def read: (?int? length, ?string? output) -> String?
8
8
  end
9
9
 
10
- MULTIPART_VALUE_COND: ^(_Reader | record_multipart_value value) -> bool
11
-
12
10
  type multipart_value = string | Pathname | File | Tempfile | _Reader
13
11
 
14
12
  type record_multipart_value = { content_type: String, filename: String, body: multipart_value } |
@@ -22,6 +20,10 @@ module HTTPX
22
20
 
23
21
  def self?.multipart?: (form_nested_value | multipart_nested_value form_data) -> bool
24
22
 
23
+ def self?.multipart_value?: (multipart_nested_value value) -> bool
24
+
25
+ def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?_KeyNormalizer transcoder) { (String, ?untyped) -> U } -> U
26
+
25
27
  class Encoder
26
28
  @boundary: String
27
29
  @part_index: Integer
data/sig/transcoder.rbs CHANGED
@@ -3,8 +3,12 @@ module HTTPX
3
3
 
4
4
  type body_encoder = (Transcoder::_Encoder & _ToS) | (Transcoder::_Encoder & _Reader) | (Transcoder::_Encoder & _Each[String])
5
5
 
6
+ interface _KeyNormalizer
7
+ def normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?_KeyNormalizer transcoder) { (String, ?untyped) -> U } -> U
8
+ end
9
+
6
10
  module Transcoder
7
- def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?(^(untyped value) -> bool | nil) cond) { (String, ?untyped) -> U } -> U
11
+ def self?.normalize_keys: [U] (_ToS key, _ToAry[untyped] | _ToHash[_ToS, untyped] | untyped value, ?_KeyNormalizer transcoder) { (String, ?untyped) -> U } -> U
8
12
 
9
13
  def self?.normalize_query: (Hash[String, untyped] params, String name, String v, Integer depth) -> void
10
14
 
data/sig/utils.rbs CHANGED
@@ -15,5 +15,7 @@ module HTTPX
15
15
  def self?.to_uri: (generic_uri uri) -> URI::Generic
16
16
 
17
17
  def self?.get_filename: (String header) -> String?
18
+
19
+ def self?.in_ractor?: () -> bool
18
20
  end
19
21
  end
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.6.3
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -159,6 +159,8 @@ extra_rdoc_files:
159
159
  - doc/release_notes/1_6_1.md
160
160
  - doc/release_notes/1_6_2.md
161
161
  - doc/release_notes/1_6_3.md
162
+ - doc/release_notes/1_7_0.md
163
+ - doc/release_notes/1_7_1.md
162
164
  files:
163
165
  - LICENSE.txt
164
166
  - README.md
@@ -290,6 +292,8 @@ files:
290
292
  - doc/release_notes/1_6_1.md
291
293
  - doc/release_notes/1_6_2.md
292
294
  - doc/release_notes/1_6_3.md
295
+ - doc/release_notes/1_7_0.md
296
+ - doc/release_notes/1_7_1.md
293
297
  - lib/httpx.rb
294
298
  - lib/httpx/adapters/datadog.rb
295
299
  - lib/httpx/adapters/faraday.rb
@@ -371,6 +375,9 @@ files:
371
375
  - lib/httpx/request.rb
372
376
  - lib/httpx/request/body.rb
373
377
  - lib/httpx/resolver.rb
378
+ - lib/httpx/resolver/cache.rb
379
+ - lib/httpx/resolver/cache/base.rb
380
+ - lib/httpx/resolver/cache/memory.rb
374
381
  - lib/httpx/resolver/entry.rb
375
382
  - lib/httpx/resolver/https.rb
376
383
  - lib/httpx/resolver/multi.rb
@@ -472,6 +479,9 @@ files:
472
479
  - sig/request.rbs
473
480
  - sig/request/body.rbs
474
481
  - sig/resolver.rbs
482
+ - sig/resolver/cache.rbs
483
+ - sig/resolver/cache/base.rbs
484
+ - sig/resolver/cache/memory.rbs
475
485
  - sig/resolver/entry.rbs
476
486
  - sig/resolver/https.rbs
477
487
  - sig/resolver/multi.rbs