httpx 1.3.4 → 1.4.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.
- checksums.yaml +4 -4
- data/doc/release_notes/1_4_0.md +43 -0
- data/doc/release_notes/1_4_1.md +19 -0
- data/lib/httpx/adapters/datadog.rb +55 -83
- data/lib/httpx/adapters/faraday.rb +2 -0
- data/lib/httpx/adapters/webmock.rb +18 -6
- data/lib/httpx/callbacks.rb +0 -5
- data/lib/httpx/chainable.rb +3 -1
- data/lib/httpx/connection/http2.rb +12 -8
- data/lib/httpx/connection.rb +192 -22
- data/lib/httpx/errors.rb +12 -0
- data/lib/httpx/loggable.rb +5 -5
- data/lib/httpx/options.rb +26 -16
- data/lib/httpx/plugins/aws_sigv4.rb +31 -16
- data/lib/httpx/plugins/callbacks.rb +12 -2
- data/lib/httpx/plugins/circuit_breaker.rb +0 -5
- data/lib/httpx/plugins/content_digest.rb +202 -0
- data/lib/httpx/plugins/expect.rb +4 -3
- data/lib/httpx/plugins/follow_redirects.rb +7 -8
- data/lib/httpx/plugins/grpc/grpc_encoding.rb +2 -0
- data/lib/httpx/plugins/h2c.rb +23 -20
- data/lib/httpx/plugins/internal_telemetry.rb +27 -0
- data/lib/httpx/plugins/persistent.rb +16 -0
- data/lib/httpx/plugins/proxy/http.rb +17 -19
- data/lib/httpx/plugins/proxy.rb +91 -93
- data/lib/httpx/plugins/retries.rb +5 -8
- data/lib/httpx/plugins/upgrade.rb +5 -10
- data/lib/httpx/plugins/webdav.rb +6 -0
- data/lib/httpx/plugins/xml.rb +76 -0
- data/lib/httpx/pool.rb +73 -244
- data/lib/httpx/request/body.rb +25 -26
- data/lib/httpx/request.rb +7 -1
- data/lib/httpx/resolver/https.rb +15 -20
- data/lib/httpx/resolver/multi.rb +34 -16
- data/lib/httpx/resolver/native.rb +66 -25
- data/lib/httpx/resolver/resolver.rb +59 -15
- data/lib/httpx/resolver/system.rb +31 -15
- data/lib/httpx/resolver.rb +21 -14
- data/lib/httpx/response.rb +5 -3
- data/lib/httpx/selector.rb +160 -95
- data/lib/httpx/session.rb +273 -140
- data/lib/httpx/transcoder/body.rb +15 -31
- data/lib/httpx/transcoder/gzip.rb +0 -3
- data/lib/httpx/transcoder/json.rb +14 -2
- data/lib/httpx/transcoder/multipart/part.rb +1 -1
- data/lib/httpx/transcoder/utils/deflater.rb +7 -4
- data/lib/httpx/transcoder/utils/inflater.rb +2 -0
- data/lib/httpx/transcoder.rb +0 -1
- data/lib/httpx/version.rb +1 -1
- data/lib/httpx.rb +20 -21
- data/sig/callbacks.rbs +0 -1
- data/sig/chainable.rbs +4 -0
- data/sig/connection/http2.rbs +1 -1
- data/sig/connection.rbs +29 -3
- data/sig/errors.rbs +6 -0
- data/sig/loggable.rbs +2 -0
- data/sig/options.rbs +7 -0
- data/sig/plugins/aws_sigv4.rbs +8 -2
- data/sig/plugins/content_digest.rbs +51 -0
- data/sig/plugins/cookies/cookie.rbs +9 -0
- data/sig/plugins/grpc/call.rbs +4 -0
- data/sig/plugins/persistent.rbs +4 -1
- data/sig/plugins/proxy/socks5.rbs +11 -3
- data/sig/plugins/proxy.rbs +18 -11
- data/sig/plugins/push_promise.rbs +3 -0
- data/sig/plugins/rate_limiter.rbs +2 -0
- data/sig/plugins/retries.rbs +1 -1
- data/sig/plugins/ssrf_filter.rbs +26 -0
- data/sig/plugins/webdav.rbs +23 -0
- data/sig/plugins/xml.rbs +37 -0
- data/sig/pool.rbs +25 -33
- data/sig/request/body.rbs +5 -9
- data/sig/resolver/multi.rbs +26 -1
- data/sig/resolver/native.rbs +2 -2
- data/sig/resolver/resolver.rbs +21 -2
- data/sig/resolver.rbs +5 -1
- data/sig/response/buffer.rbs +1 -1
- data/sig/selector.rbs +30 -4
- data/sig/session.rbs +47 -18
- data/sig/transcoder/body.rbs +2 -4
- data/sig/transcoder/chunker.rbs +1 -1
- data/sig/transcoder/deflate.rbs +1 -0
- data/sig/transcoder/form.rbs +8 -0
- data/sig/transcoder/gzip.rbs +4 -1
- data/sig/transcoder/utils/body_reader.rbs +3 -3
- data/sig/transcoder/utils/deflater.rbs +3 -3
- metadata +12 -4
- data/lib/httpx/transcoder/xml.rb +0 -52
- data/sig/transcoder/xml.rbs +0 -22
data/lib/httpx/version.rb
CHANGED
data/lib/httpx.rb
CHANGED
@@ -2,28 +2,11 @@
|
|
2
2
|
|
3
3
|
require "httpx/version"
|
4
4
|
|
5
|
-
require "httpx/extensions"
|
6
|
-
|
7
|
-
require "httpx/errors"
|
8
|
-
require "httpx/utils"
|
9
|
-
require "httpx/punycode"
|
10
|
-
require "httpx/domain_name"
|
11
|
-
require "httpx/altsvc"
|
12
|
-
require "httpx/callbacks"
|
13
|
-
require "httpx/loggable"
|
14
|
-
require "httpx/transcoder"
|
15
|
-
require "httpx/timers"
|
16
|
-
require "httpx/pool"
|
17
|
-
require "httpx/headers"
|
18
|
-
require "httpx/request"
|
19
|
-
require "httpx/response"
|
20
|
-
require "httpx/options"
|
21
|
-
require "httpx/chainable"
|
22
|
-
|
23
5
|
# Top-Level Namespace
|
24
6
|
#
|
25
7
|
module HTTPX
|
26
8
|
EMPTY = [].freeze
|
9
|
+
EMPTY_HASH = {}.freeze
|
27
10
|
|
28
11
|
# All plugins should be stored under this module/namespace. Can register and load
|
29
12
|
# plugins.
|
@@ -53,15 +36,31 @@ module HTTPX
|
|
53
36
|
m.synchronize { h[name] = mod }
|
54
37
|
end
|
55
38
|
end
|
56
|
-
|
57
|
-
extend Chainable
|
58
39
|
end
|
59
40
|
|
41
|
+
require "httpx/extensions"
|
42
|
+
|
43
|
+
require "httpx/errors"
|
44
|
+
require "httpx/utils"
|
45
|
+
require "httpx/punycode"
|
46
|
+
require "httpx/domain_name"
|
47
|
+
require "httpx/altsvc"
|
48
|
+
require "httpx/callbacks"
|
49
|
+
require "httpx/loggable"
|
50
|
+
require "httpx/transcoder"
|
51
|
+
require "httpx/timers"
|
52
|
+
require "httpx/pool"
|
53
|
+
require "httpx/headers"
|
54
|
+
require "httpx/request"
|
55
|
+
require "httpx/response"
|
56
|
+
require "httpx/options"
|
57
|
+
require "httpx/chainable"
|
58
|
+
|
60
59
|
require "httpx/session"
|
61
60
|
require "httpx/session_extensions"
|
62
61
|
|
63
62
|
# load integrations when possible
|
64
63
|
|
65
|
-
require "httpx/adapters/datadog" if defined?(DDTrace) || defined?(Datadog)
|
64
|
+
require "httpx/adapters/datadog" if defined?(DDTrace) || defined?(Datadog::Tracing)
|
66
65
|
require "httpx/adapters/sentry" if defined?(Sentry)
|
67
66
|
require "httpx/adapters/webmock" if defined?(WebMock)
|
data/sig/callbacks.rbs
CHANGED
@@ -6,7 +6,6 @@ module HTTPX
|
|
6
6
|
module Callbacks
|
7
7
|
def on: (Symbol) { (*untyped) -> void } -> self
|
8
8
|
def once: (Symbol) { (*untyped) -> void } -> self
|
9
|
-
def only: (Symbol) { (*untyped) -> void } -> self
|
10
9
|
def emit: (Symbol, *untyped) -> void
|
11
10
|
|
12
11
|
def callbacks_for?: (Symbol) -> bool
|
data/sig/chainable.rbs
CHANGED
@@ -35,6 +35,10 @@ module HTTPX
|
|
35
35
|
| (:circuit_breaker, ?options) -> Plugins::sessionCircuitBreaker
|
36
36
|
| (:oauth, ?options) -> Plugins::sessionOAuth
|
37
37
|
| (:callbacks, ?options) -> Plugins::sessionCallbacks
|
38
|
+
| (:content_digest, ?options) -> Plugins::sessionContentDigest
|
39
|
+
| (:ssrf_filter, ?options) -> Plugins::sessionSsrf
|
40
|
+
| (:webdav, ?options) -> Plugins::sessionWebDav
|
41
|
+
| (:xml, ?options) -> Plugins::sessionXML
|
38
42
|
| (Symbol | Module, ?options) { (Class) -> void } -> Session
|
39
43
|
| (Symbol | Module, ?options) -> Session
|
40
44
|
|
data/sig/connection/http2.rbs
CHANGED
data/sig/connection.rbs
CHANGED
@@ -26,10 +26,12 @@ module HTTPX
|
|
26
26
|
attr_reader pending: Array[Request]
|
27
27
|
attr_reader options: Options
|
28
28
|
attr_reader ssl_session: OpenSSL::SSL::Session?
|
29
|
-
|
30
|
-
|
29
|
+
attr_reader sibling: instance?
|
30
|
+
attr_writer current_selector: Selector?
|
31
|
+
attr_accessor current_session: Session?
|
31
32
|
attr_accessor family: Integer?
|
32
33
|
|
34
|
+
|
33
35
|
@window_size: Integer
|
34
36
|
@read_buffer: Buffer
|
35
37
|
@write_buffer: Buffer
|
@@ -42,9 +44,17 @@ module HTTPX
|
|
42
44
|
@connected_at: Float
|
43
45
|
@response_received_at: Float
|
44
46
|
@intervals: Array[Timers::Interval]
|
47
|
+
@exhausted: bool
|
48
|
+
@cloned: bool
|
49
|
+
@coalesced_connection: instance?
|
50
|
+
@sibling: instance?
|
51
|
+
@main_sibling: bool
|
52
|
+
|
45
53
|
|
46
54
|
def addresses: () -> Array[ipaddr]?
|
47
55
|
|
56
|
+
def peer: () -> URI::Generic
|
57
|
+
|
48
58
|
def addresses=: (Array[ipaddr] addresses) -> void
|
49
59
|
|
50
60
|
def send: (Request request) -> void
|
@@ -57,7 +67,7 @@ module HTTPX
|
|
57
67
|
|
58
68
|
def coalescable?: (Connection connection) -> bool
|
59
69
|
|
60
|
-
def create_idle: (?Hash[Symbol, untyped] options) ->
|
70
|
+
def create_idle: (?Hash[Symbol, untyped] options) -> instance
|
61
71
|
|
62
72
|
def merge: (Connection connection) -> void
|
63
73
|
|
@@ -65,6 +75,8 @@ module HTTPX
|
|
65
75
|
|
66
76
|
def connecting?: () -> bool
|
67
77
|
|
78
|
+
def io_connected?: () -> bool
|
79
|
+
|
68
80
|
def inflight?: () -> boolish
|
69
81
|
|
70
82
|
def interests: () -> io_interests?
|
@@ -77,6 +89,8 @@ module HTTPX
|
|
77
89
|
|
78
90
|
def close: () -> void
|
79
91
|
|
92
|
+
def force_reset: (?bool cloned) -> void
|
93
|
+
|
80
94
|
def reset: () -> void
|
81
95
|
|
82
96
|
def timeout: () -> Numeric?
|
@@ -91,6 +105,12 @@ module HTTPX
|
|
91
105
|
|
92
106
|
def handle_socket_timeout: (Numeric interval) -> void
|
93
107
|
|
108
|
+
def coalesced_connection=: (instance connection) -> void
|
109
|
+
|
110
|
+
def sibling=: (instance? connection) -> void
|
111
|
+
|
112
|
+
def handle_connect_error: (StandardError error) -> void
|
113
|
+
|
94
114
|
private
|
95
115
|
|
96
116
|
def initialize: (http_uri uri, Options options) -> void
|
@@ -99,6 +119,8 @@ module HTTPX
|
|
99
119
|
|
100
120
|
def connect: () -> void
|
101
121
|
|
122
|
+
def disconnect: () -> void
|
123
|
+
|
102
124
|
def exhausted?: () -> boolish
|
103
125
|
|
104
126
|
def consume: () -> void
|
@@ -117,12 +139,16 @@ module HTTPX
|
|
117
139
|
|
118
140
|
def handle_transition: (Symbol nextstate) -> void
|
119
141
|
|
142
|
+
def build_altsvc_connection: (URI::Generic alt_origin, String origin, Hash[String, String] alt_params) -> void
|
143
|
+
|
120
144
|
def build_socket: (?Array[ipaddr]? addrs) -> (TCP | SSL | UNIX)
|
121
145
|
|
122
146
|
def on_error: (HTTPX::TimeoutError | Error | StandardError error, ?Request? request) -> void
|
123
147
|
|
124
148
|
def handle_error: (StandardError error, ?Request? request) -> void
|
125
149
|
|
150
|
+
def close_sibling: () -> void
|
151
|
+
|
126
152
|
def purge_after_closed: () -> void
|
127
153
|
|
128
154
|
def set_request_timeouts: (Request request) -> void
|
data/sig/errors.rbs
CHANGED
@@ -17,6 +17,12 @@ module HTTPX
|
|
17
17
|
def initialize: (Numeric timeout, String message) -> untyped
|
18
18
|
end
|
19
19
|
|
20
|
+
class PoolTimeoutError < TimeoutError
|
21
|
+
attr_reader origin: String
|
22
|
+
|
23
|
+
def initialize: (String origin, Numeric timeout) -> void
|
24
|
+
end
|
25
|
+
|
20
26
|
class ConnectTimeoutError < TimeoutError
|
21
27
|
end
|
22
28
|
|
data/sig/loggable.rbs
CHANGED
data/sig/options.rbs
CHANGED
@@ -77,6 +77,8 @@ module HTTPX
|
|
77
77
|
# classes
|
78
78
|
attr_reader connection_class: singleton(Connection)
|
79
79
|
|
80
|
+
attr_reader pool_class: singleton(Pool)
|
81
|
+
|
80
82
|
attr_reader request_class: singleton(Request)
|
81
83
|
|
82
84
|
attr_reader response_class: singleton(Response)
|
@@ -110,6 +112,9 @@ module HTTPX
|
|
110
112
|
# resolver_options
|
111
113
|
attr_reader resolver_options: Hash[Symbol, untyped]
|
112
114
|
|
115
|
+
# resolver_options
|
116
|
+
attr_reader pool_options: pool_options
|
117
|
+
|
113
118
|
# ip_families
|
114
119
|
attr_reader ip_families: Array[ip_family]
|
115
120
|
|
@@ -130,6 +135,8 @@ module HTTPX
|
|
130
135
|
def initialize: (?options options) -> void
|
131
136
|
|
132
137
|
def do_initialize: (?options options) -> void
|
138
|
+
|
139
|
+
def access_option: (Hash[Symbol, untyped] | Object | nil obj, Symbol k, Hash[Symbol, Symbol]? ivar_map) -> untyped
|
133
140
|
end
|
134
141
|
|
135
142
|
type options = Options | Hash[Symbol, untyped]
|
data/sig/plugins/aws_sigv4.rbs
CHANGED
@@ -17,8 +17,14 @@ module HTTPX
|
|
17
17
|
|
18
18
|
|
19
19
|
class Signer
|
20
|
-
|
20
|
+
@credentials: Object & _SigV4Credentials
|
21
|
+
@service: String
|
22
|
+
@region: String
|
21
23
|
@unsigned_headers: Set[String]
|
24
|
+
@apply_checksum_header: bool
|
25
|
+
@provider_prefix: String
|
26
|
+
@header_provider_field: String
|
27
|
+
@algorithm: String
|
22
28
|
|
23
29
|
def sign!: (Request & RequestMethods request) -> void
|
24
30
|
|
@@ -41,7 +47,7 @@ module HTTPX
|
|
41
47
|
) -> untyped
|
42
48
|
|
43
49
|
|
44
|
-
def hexdigest: (
|
50
|
+
def hexdigest: (Request::Body value) -> String
|
45
51
|
|
46
52
|
def hmac: (String key, String value) -> String
|
47
53
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module HTTPX
|
2
|
+
module Plugins
|
3
|
+
module ContentDigest
|
4
|
+
class Error < HTTPX::Error
|
5
|
+
end
|
6
|
+
class ValidationError < Error
|
7
|
+
attr_reader response: Response
|
8
|
+
|
9
|
+
def initialize: (String message, Response response) -> void
|
10
|
+
end
|
11
|
+
class MissingContentDigestError < ValidationError
|
12
|
+
end
|
13
|
+
class InvalidContentDigestError < ValidationError
|
14
|
+
end
|
15
|
+
|
16
|
+
SUPPORTED_ALGORITHMS: Hash[String, singleton(OpenSSL::Digest)]
|
17
|
+
|
18
|
+
interface _ContentDigestOptions
|
19
|
+
def digest_algorithm: () -> String
|
20
|
+
def encode_content_digest: () -> (bool | ^(Request) -> boolish)
|
21
|
+
def validate_content_digest: () -> (bool | ^(contentDigestResponse) -> boolish)
|
22
|
+
end
|
23
|
+
|
24
|
+
# def self.extra_options: (Options) -> contentDigestOptions
|
25
|
+
|
26
|
+
module InstanceMethods
|
27
|
+
private
|
28
|
+
|
29
|
+
def validate_content_digest: (Response response) -> void
|
30
|
+
|
31
|
+
def extract_content_digests: (String) -> Hash[String, String]
|
32
|
+
|
33
|
+
def base64digest: (Request::Body | contentDigestResponseBody body) -> String
|
34
|
+
end
|
35
|
+
|
36
|
+
module ResponseMethods
|
37
|
+
attr_reader body: contentDigestResponseBody
|
38
|
+
end
|
39
|
+
|
40
|
+
module ResponseBodyMethods
|
41
|
+
attr_reader content_digest_buffer: Response::Buffer?
|
42
|
+
end
|
43
|
+
|
44
|
+
type contentDigestOptions = Options & _ContentDigestOptions
|
45
|
+
type contentDigestResponse = Response & ResponseMethods
|
46
|
+
type contentDigestResponseBody = Response::Body & ResponseBodyMethods
|
47
|
+
end
|
48
|
+
|
49
|
+
type sessionContentDigest = Session & ContentDigest::InstanceMethods
|
50
|
+
end
|
51
|
+
end
|
@@ -17,6 +17,10 @@ module HTTPX
|
|
17
17
|
|
18
18
|
attr_reader created_at: Time
|
19
19
|
|
20
|
+
@for_domain: bool
|
21
|
+
|
22
|
+
@domain_name: DomainName
|
23
|
+
|
20
24
|
def path=: (string) -> void
|
21
25
|
|
22
26
|
def domain=: (string) -> void
|
@@ -43,6 +47,11 @@ module HTTPX
|
|
43
47
|
| (_ToS, _ToS, ?cookie_attributes) -> untyped
|
44
48
|
|
45
49
|
def acceptable_from_uri?: (uri) -> bool
|
50
|
+
|
51
|
+
module Scanner
|
52
|
+
RE_BAD_CHAR: Regexp
|
53
|
+
def self?.quote: (String s) -> String
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
48
57
|
end
|
data/sig/plugins/grpc/call.rbs
CHANGED
data/sig/plugins/persistent.rbs
CHANGED
@@ -4,8 +4,11 @@ module HTTPX
|
|
4
4
|
def self.load_dependencies: (singleton(Session)) -> void
|
5
5
|
|
6
6
|
def self.extra_options: (Options) -> (Options)
|
7
|
+
|
8
|
+
module InstanceMethods
|
9
|
+
end
|
7
10
|
end
|
8
11
|
|
9
|
-
type sessionPersistent =
|
12
|
+
type sessionPersistent = Session & Persistent::InstanceMethods
|
10
13
|
end
|
11
14
|
end
|
@@ -6,6 +6,14 @@ module HTTPX
|
|
6
6
|
module Proxy
|
7
7
|
module Socks5
|
8
8
|
VERSION: Integer
|
9
|
+
NOAUTH: Integer
|
10
|
+
PASSWD: Integer
|
11
|
+
NONE: Integer
|
12
|
+
CONNECT: Integer
|
13
|
+
IPV4: Integer
|
14
|
+
DOMAIN: Integer
|
15
|
+
IPV6: Integer
|
16
|
+
SUCCESS: Integer
|
9
17
|
|
10
18
|
module ConnectionMethods
|
11
19
|
def __socks5_proxy_connect: () -> void
|
@@ -31,9 +39,9 @@ module HTTPX
|
|
31
39
|
end
|
32
40
|
|
33
41
|
module Packet
|
34
|
-
def self?.negotiate: (Parameters) -> String
|
35
|
-
def self?.authenticate: (Parameters) -> String
|
36
|
-
def self?.connect: (uri) -> String
|
42
|
+
def self?.negotiate: (Parameters parameters) -> String
|
43
|
+
def self?.authenticate: (Parameters parameters) -> String
|
44
|
+
def self?.connect: (uri uri) -> String
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
data/sig/plugins/proxy.rbs
CHANGED
@@ -6,15 +6,25 @@ module HTTPX
|
|
6
6
|
end
|
7
7
|
|
8
8
|
module Plugins
|
9
|
+
interface _Authenticator
|
10
|
+
def authenticate: (Request request, String authenticate) -> String
|
11
|
+
end
|
12
|
+
|
9
13
|
module Proxy
|
10
14
|
Error: singleton(HTTPProxyError)
|
11
15
|
PROXY_ERRORS: Array[singleton(StandardError)]
|
12
16
|
|
13
17
|
class Parameters
|
14
|
-
attr_reader uri: URI::Generic
|
18
|
+
attr_reader uri: URI::Generic?
|
15
19
|
attr_reader username: String?
|
16
20
|
attr_reader password: String?
|
17
21
|
attr_reader scheme: String?
|
22
|
+
attr_reader no_proxy: Array[String]?
|
23
|
+
|
24
|
+
@uris: Array[URI::Generic | String]
|
25
|
+
@authenticator: _Authenticator
|
26
|
+
|
27
|
+
def shift: () -> void
|
18
28
|
|
19
29
|
def can_authenticate?: (*untyped) -> boolish
|
20
30
|
|
@@ -24,15 +34,17 @@ module HTTPX
|
|
24
34
|
|
25
35
|
private
|
26
36
|
|
27
|
-
def initialize: (uri: generic_uri, ?scheme: String, ?username: String, ?password: String, **untyped) ->
|
37
|
+
def initialize: (?uri: generic_uri | Array[generic_uri], ?scheme: String, ?username: String, ?password: String, ?no_proxy: Array[generic_uri] | generic_uri, **untyped) -> void
|
38
|
+
|
39
|
+
def infer_default_auth_scheme: (URI::Generic uri) -> String?
|
40
|
+
|
41
|
+
def load_authenticator: (String scheme, String username, String password, **untyped) -> _Authenticator
|
28
42
|
end
|
29
43
|
|
30
44
|
def self.configure: (singleton(Session)) -> void
|
31
45
|
|
32
|
-
type proxyParam = Parameters | Hash[Symbol, untyped]
|
33
|
-
|
34
46
|
interface _ProxyOptions
|
35
|
-
def proxy: () ->
|
47
|
+
def proxy: () -> Parameters?
|
36
48
|
end
|
37
49
|
|
38
50
|
def self.extra_options: (Options) -> (Options & _ProxyOptions)
|
@@ -42,12 +54,7 @@ module HTTPX
|
|
42
54
|
|
43
55
|
private
|
44
56
|
|
45
|
-
def proxy_error?: (Request request, response) -> bool
|
46
|
-
|
47
|
-
def proxy_options: (http_uri request_uri, Options & _ProxyOptions options) -> (Options & _ProxyOptions)
|
48
|
-
end
|
49
|
-
|
50
|
-
module ConnectionMethods
|
57
|
+
def proxy_error?: (Request request, response, Options options) -> bool
|
51
58
|
end
|
52
59
|
end
|
53
60
|
|
@@ -2,11 +2,14 @@ module HTTPX
|
|
2
2
|
module Plugins
|
3
3
|
module PushPromise
|
4
4
|
module ResponseMethods
|
5
|
+
@__pushed: bool?
|
6
|
+
|
5
7
|
def pushed?: () -> boolish
|
6
8
|
def mark_as_pushed!: () -> void
|
7
9
|
end
|
8
10
|
|
9
11
|
module InstanceMethods
|
12
|
+
@promise_headers: Hash[::HTTP2::Stream, Request]?
|
10
13
|
private
|
11
14
|
|
12
15
|
def promise_headers: () -> Hash[::HTTP2::Stream, Request]
|
data/sig/plugins/retries.rbs
CHANGED
@@ -29,7 +29,7 @@ module HTTPX
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
-
def fetch_response: (retriesRequest request,
|
32
|
+
def fetch_response: (retriesRequest request, Selector selector, retriesOptions options) -> (retriesResponse | ErrorResponse)?
|
33
33
|
|
34
34
|
def __repeatable_request?: (retriesRequest request, retriesOptions options) -> boolish
|
35
35
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module HTTPX
|
2
|
+
class ServerSideRequestForgeryError < Error
|
3
|
+
end
|
4
|
+
|
5
|
+
module Plugins
|
6
|
+
module SsrfFilter
|
7
|
+
IPV4_BLACKLIST: Array[IPAddr]
|
8
|
+
|
9
|
+
IPV6_BLACKLIST: Array[[IPAddr, IPAddr]]
|
10
|
+
|
11
|
+
def self?.unsafe_ip_address?: (IPAddr) -> bool
|
12
|
+
|
13
|
+
interface _Options
|
14
|
+
def allowed_schemes: () -> Array[String]
|
15
|
+
end
|
16
|
+
|
17
|
+
module InstanceMethods
|
18
|
+
end
|
19
|
+
|
20
|
+
module ConnectionMethods
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
type sessionSsrf = Session & SsrfFilter::InstanceMethods
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module HTTPX
|
2
|
+
module Plugins
|
3
|
+
module WebDav
|
4
|
+
module InstanceMethods
|
5
|
+
def copy: (String src, String dst) -> (Response | ErrorResponse)
|
6
|
+
|
7
|
+
def move: (String src, String dst) -> (Response | ErrorResponse)
|
8
|
+
|
9
|
+
def lock: (String path, ?timeout: Numeric) ?{ (Response response) -> void } -> (Response | ErrorResponse)
|
10
|
+
|
11
|
+
def unlock: (String path, String? lock_token) -> (Response | ErrorResponse)
|
12
|
+
|
13
|
+
def mkcol: (String dir) -> Response
|
14
|
+
|
15
|
+
def propfind: (String path, ?(:acl | String) xml) -> Response
|
16
|
+
|
17
|
+
def proppatch: (String path, String xml) -> Response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
type sessionWebDav = Session & WebDav::InstanceMethods
|
22
|
+
end
|
23
|
+
end
|
data/sig/plugins/xml.rbs
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
module HTTPX
|
2
|
+
module Plugins
|
3
|
+
module XML
|
4
|
+
MIME_TYPES: Regexp
|
5
|
+
|
6
|
+
module Transcoder
|
7
|
+
def self?.encode: (Nokogiri::XML::Node | String xml) -> Encoder
|
8
|
+
def self?.decode: (HTTPX::Response response) -> HTTPX::Transcoder::_Decoder
|
9
|
+
|
10
|
+
class Encoder
|
11
|
+
@raw: Nokogiri::XML::Node | String # can be nokogiri object
|
12
|
+
|
13
|
+
def content_type: () -> String
|
14
|
+
|
15
|
+
def bytesize: () -> (Integer | Float)
|
16
|
+
|
17
|
+
def to_s: () -> String
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def initialize: (Nokogiri::XML::Node | String xml) -> void
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module InstanceMethods
|
26
|
+
end
|
27
|
+
|
28
|
+
module ResponseMethods
|
29
|
+
def xml: () -> Nokogiri::XML::Node
|
30
|
+
end
|
31
|
+
|
32
|
+
module RequestBodyClassMethods
|
33
|
+
end
|
34
|
+
end
|
35
|
+
type sessionXML = Session & XML::InstanceMethods
|
36
|
+
end
|
37
|
+
end
|
data/sig/pool.rbs
CHANGED
@@ -1,52 +1,44 @@
|
|
1
1
|
module HTTPX
|
2
|
+
type pool_options = {
|
3
|
+
max_connections_per_origin: Integer?,
|
4
|
+
pool_timeout: Numeric?
|
5
|
+
}
|
6
|
+
|
2
7
|
class Pool
|
3
8
|
type resolver_manager = Resolver::Multi | Resolver::System
|
4
9
|
|
5
|
-
@
|
6
|
-
@
|
7
|
-
@
|
8
|
-
@
|
10
|
+
@max_connections_per_origin: Integer
|
11
|
+
@pool_timeout: Numeric
|
12
|
+
@options: Options
|
13
|
+
@resolvers: Hash[Class, Array[resolver_manager]]
|
14
|
+
@resolver_mtx: Thread::Mutex
|
15
|
+
@connections: Hash[String, Array[Connection]]
|
16
|
+
@connection_mtx: Thread::Mutex
|
17
|
+
@origin_counters: Hash[String, Integer]
|
18
|
+
@origin_conds: Hash[String, ConditionVariable]
|
9
19
|
|
10
|
-
def
|
20
|
+
def pop_connection: () -> Connection?
|
11
21
|
|
12
|
-
def
|
22
|
+
def checkout_connection: (http_uri uri, Options options) -> Connection
|
13
23
|
|
14
|
-
def
|
24
|
+
def checkin_connection: (Connection connection) -> void
|
15
25
|
|
16
|
-
def
|
26
|
+
def checkout_mergeable_connection: (Connection connection) -> Connection?
|
17
27
|
|
18
|
-
def
|
28
|
+
def reset_resolvers: () -> void
|
19
29
|
|
20
|
-
def
|
30
|
+
def checkout_resolver: (Options options) -> resolver_manager
|
21
31
|
|
22
|
-
def
|
32
|
+
def checkin_resolver: (Resolver::Resolver resolver) -> void
|
23
33
|
|
24
34
|
private
|
25
35
|
|
26
|
-
def initialize: () -> void
|
27
|
-
|
28
|
-
def try_clone_connection: (Connection connection, Integer? family) -> Connection
|
29
|
-
|
30
|
-
def resolve_connection: (Connection) -> void
|
31
|
-
|
32
|
-
def on_resolver_connection: (Connection) -> void
|
33
|
-
|
34
|
-
def on_resolver_error: (Connection, StandardError) -> void
|
35
|
-
|
36
|
-
def on_resolver_close: (Resolver::Resolver) -> void
|
37
|
-
|
38
|
-
def register_connection: (Connection) -> void
|
39
|
-
|
40
|
-
def unregister_connection: (Connection, ?bool cleanup) -> void
|
41
|
-
|
42
|
-
def select_connection: (Selector::selectable) -> void
|
43
|
-
|
44
|
-
def deselect_connection: (Selector::selectable) -> Selector::selectable?
|
36
|
+
def initialize: (pool_options options) -> void
|
45
37
|
|
46
|
-
def
|
38
|
+
def acquire_connection: (http_uri uri, Options options) -> Connection?
|
47
39
|
|
48
|
-
def
|
40
|
+
def checkout_new_connection: (http_uri uri, Options options) -> Connection
|
49
41
|
|
50
|
-
def
|
42
|
+
def checkout_new_resolver: (Class resolver_type, Options options) -> resolver_manager
|
51
43
|
end
|
52
44
|
end
|