httpx 0.11.3 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/doc/release_notes/0_10_1.md +1 -1
- data/doc/release_notes/0_11_1.md +5 -1
- data/doc/release_notes/0_12_0.md +55 -0
- data/doc/release_notes/0_13_0.md +58 -0
- data/doc/release_notes/0_13_1.md +5 -0
- data/doc/release_notes/0_13_2.md +9 -0
- data/doc/release_notes/0_14_0.md +79 -0
- data/lib/httpx.rb +3 -3
- data/lib/httpx/adapters/faraday.rb +4 -6
- data/lib/httpx/altsvc.rb +1 -0
- data/lib/httpx/callbacks.rb +12 -3
- data/lib/httpx/chainable.rb +2 -2
- data/lib/httpx/connection.rb +92 -37
- data/lib/httpx/connection/http1.rb +37 -19
- data/lib/httpx/connection/http2.rb +82 -31
- data/lib/httpx/headers.rb +1 -1
- data/lib/httpx/io.rb +16 -3
- data/lib/httpx/io/ssl.rb +35 -24
- data/lib/httpx/io/tcp.rb +50 -28
- data/lib/httpx/io/tls.rb +218 -0
- data/lib/httpx/io/tls/box.rb +365 -0
- data/lib/httpx/io/tls/context.rb +199 -0
- data/lib/httpx/io/tls/ffi.rb +390 -0
- data/lib/httpx/io/udp.rb +31 -7
- data/lib/httpx/io/unix.rb +27 -12
- data/lib/httpx/options.rb +97 -74
- data/lib/httpx/parser/http1.rb +4 -4
- data/lib/httpx/plugins/aws_sdk_authentication.rb +84 -0
- data/lib/httpx/plugins/aws_sigv4.rb +219 -0
- data/lib/httpx/plugins/basic_authentication.rb +8 -3
- data/lib/httpx/plugins/compression.rb +24 -12
- data/lib/httpx/plugins/compression/brotli.rb +10 -7
- data/lib/httpx/plugins/compression/deflate.rb +8 -10
- data/lib/httpx/plugins/compression/gzip.rb +4 -3
- data/lib/httpx/plugins/cookies.rb +3 -7
- data/lib/httpx/plugins/digest_authentication.rb +5 -5
- data/lib/httpx/plugins/expect.rb +6 -6
- data/lib/httpx/plugins/follow_redirects.rb +4 -4
- data/lib/httpx/plugins/grpc.rb +247 -0
- data/lib/httpx/plugins/grpc/call.rb +62 -0
- data/lib/httpx/plugins/grpc/message.rb +85 -0
- data/lib/httpx/plugins/h2c.rb +43 -58
- data/lib/httpx/plugins/internal_telemetry.rb +93 -0
- data/lib/httpx/plugins/multipart.rb +2 -0
- data/lib/httpx/plugins/multipart/encoder.rb +4 -9
- data/lib/httpx/plugins/multipart/part.rb +1 -1
- data/lib/httpx/plugins/proxy.rb +4 -8
- data/lib/httpx/plugins/proxy/http.rb +1 -1
- data/lib/httpx/plugins/proxy/socks4.rb +8 -0
- data/lib/httpx/plugins/proxy/socks5.rb +8 -0
- data/lib/httpx/plugins/proxy/ssh.rb +3 -3
- data/lib/httpx/plugins/push_promise.rb +3 -2
- data/lib/httpx/plugins/rate_limiter.rb +1 -1
- data/lib/httpx/plugins/retries.rb +15 -16
- data/lib/httpx/plugins/stream.rb +99 -77
- data/lib/httpx/plugins/upgrade.rb +84 -0
- data/lib/httpx/plugins/upgrade/h2.rb +54 -0
- data/lib/httpx/pool.rb +14 -6
- data/lib/httpx/registry.rb +1 -7
- data/lib/httpx/request.rb +36 -3
- data/lib/httpx/resolver/https.rb +3 -11
- data/lib/httpx/resolver/native.rb +7 -3
- data/lib/httpx/response.rb +18 -7
- data/lib/httpx/selector.rb +5 -0
- data/lib/httpx/session.rb +41 -8
- data/lib/httpx/transcoder/body.rb +3 -5
- data/lib/httpx/transcoder/chunker.rb +1 -1
- data/lib/httpx/version.rb +1 -1
- data/sig/callbacks.rbs +2 -0
- data/sig/chainable.rbs +2 -1
- data/sig/connection/http1.rbs +7 -2
- data/sig/connection/http2.rbs +10 -4
- data/sig/options.rbs +16 -22
- data/sig/plugins/aws_sdk_authentication.rbs +19 -0
- data/sig/plugins/aws_sigv4.rbs +64 -0
- data/sig/plugins/basic_authentication.rbs +2 -0
- data/sig/plugins/compression.rbs +7 -5
- data/sig/plugins/compression/brotli.rbs +1 -1
- data/sig/plugins/compression/deflate.rbs +1 -1
- data/sig/plugins/compression/gzip.rbs +1 -1
- data/sig/plugins/cookies.rbs +0 -1
- data/sig/plugins/digest_authentication.rbs +0 -1
- data/sig/plugins/expect.rbs +0 -2
- data/sig/plugins/follow_redirects.rbs +0 -2
- data/sig/plugins/h2c.rbs +5 -10
- data/sig/plugins/persistent.rbs +0 -1
- data/sig/plugins/proxy.rbs +0 -1
- data/sig/plugins/push_promise.rbs +1 -1
- data/sig/plugins/retries.rbs +0 -4
- data/sig/plugins/stream.rbs +17 -16
- data/sig/plugins/upgrade.rbs +23 -0
- data/sig/request.rbs +7 -2
- data/sig/response.rbs +4 -1
- data/sig/session.rbs +4 -0
- metadata +56 -33
- data/lib/httpx/timeout.rb +0 -67
- data/sig/timeout.rbs +0 -29
data/lib/httpx/timeout.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "timeout"
|
4
|
-
|
5
|
-
module HTTPX
|
6
|
-
class Timeout
|
7
|
-
CONNECT_TIMEOUT = 60
|
8
|
-
OPERATION_TIMEOUT = 60
|
9
|
-
KEEP_ALIVE_TIMEOUT = 20
|
10
|
-
|
11
|
-
def self.new(opts = {})
|
12
|
-
return opts if opts.is_a?(Timeout)
|
13
|
-
|
14
|
-
super(**opts)
|
15
|
-
end
|
16
|
-
|
17
|
-
attr_reader :connect_timeout, :operation_timeout, :keep_alive_timeout, :total_timeout
|
18
|
-
|
19
|
-
def initialize(connect_timeout: CONNECT_TIMEOUT,
|
20
|
-
operation_timeout: OPERATION_TIMEOUT,
|
21
|
-
keep_alive_timeout: KEEP_ALIVE_TIMEOUT,
|
22
|
-
total_timeout: nil,
|
23
|
-
loop_timeout: nil)
|
24
|
-
@connect_timeout = connect_timeout
|
25
|
-
@operation_timeout = operation_timeout
|
26
|
-
@keep_alive_timeout = keep_alive_timeout
|
27
|
-
@total_timeout = total_timeout
|
28
|
-
|
29
|
-
return unless loop_timeout
|
30
|
-
|
31
|
-
# :nocov:
|
32
|
-
warn ":loop_timeout is deprecated, use :operation_timeout instead"
|
33
|
-
@operation_timeout = loop_timeout
|
34
|
-
# :nocov:
|
35
|
-
end
|
36
|
-
|
37
|
-
def ==(other)
|
38
|
-
if other.is_a?(Timeout)
|
39
|
-
@connect_timeout == other.instance_variable_get(:@connect_timeout) &&
|
40
|
-
@operation_timeout == other.instance_variable_get(:@operation_timeout) &&
|
41
|
-
@keep_alive_timeout == other.instance_variable_get(:@keep_alive_timeout) &&
|
42
|
-
@total_timeout == other.instance_variable_get(:@total_timeout)
|
43
|
-
else
|
44
|
-
super
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def merge(other)
|
49
|
-
case other
|
50
|
-
when Hash
|
51
|
-
timeout = Timeout.new(other)
|
52
|
-
merge(timeout)
|
53
|
-
when Timeout
|
54
|
-
connect_timeout = other.instance_variable_get(:@connect_timeout) || @connect_timeout
|
55
|
-
operation_timeout = other.instance_variable_get(:@operation_timeout) || @operation_timeout
|
56
|
-
keep_alive_timeout = other.instance_variable_get(:@keep_alive_timeout) || @keep_alive_timeout
|
57
|
-
total_timeout = other.instance_variable_get(:@total_timeout) || @total_timeout
|
58
|
-
Timeout.new(connect_timeout: connect_timeout,
|
59
|
-
operation_timeout: operation_timeout,
|
60
|
-
keep_alive_timeout: keep_alive_timeout,
|
61
|
-
total_timeout: total_timeout)
|
62
|
-
else
|
63
|
-
raise ArgumentError, "can't merge with #{other.class}"
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
data/sig/timeout.rbs
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module HTTPX
|
2
|
-
class Timeout
|
3
|
-
CONNECT_TIMEOUT: Numeric
|
4
|
-
KEEP_ALIVE_TIMEOUT: Numeric
|
5
|
-
OPERATION_TIMEOUT: Numeric
|
6
|
-
|
7
|
-
attr_reader connect_timeout: Numeric
|
8
|
-
attr_reader operation_timeout: Numeric
|
9
|
-
attr_reader total_timeout: Numeric?
|
10
|
-
attr_reader keep_alive_timeout: Numeric?
|
11
|
-
|
12
|
-
def self.new: (instance | Hash[Symbol, untyped]) -> instance
|
13
|
-
| () -> instance
|
14
|
-
|
15
|
-
def ==: (untyped other) -> bool
|
16
|
-
|
17
|
-
def merge: (Timeout | Hash[Symbol, untyped]) -> instance
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def initialize: (
|
22
|
-
?connect_timeout: Numeric,
|
23
|
-
?operation_timeout: Numeric,
|
24
|
-
?keep_alive_timeout: Numeric,
|
25
|
-
?total_timeout: Numeric | nil,
|
26
|
-
?loop_timeout: Numeric | nil
|
27
|
-
) -> untyped
|
28
|
-
end
|
29
|
-
end
|