httpx 0.15.0 → 0.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/release_notes/0_15_0.md +9 -0
- data/doc/release_notes/0_15_1.md +8 -0
- data/doc/release_notes/0_15_2.md +9 -0
- data/doc/release_notes/0_15_3.md +5 -0
- data/doc/release_notes/0_15_4.md +5 -0
- data/lib/httpx/connection/http1.rb +17 -6
- data/lib/httpx/loggable.rb +1 -1
- data/lib/httpx/options.rb +3 -1
- data/lib/httpx/plugins/cookies/cookie.rb +1 -2
- data/lib/httpx/plugins/cookies/jar.rb +4 -0
- data/lib/httpx/plugins/grpc.rb +1 -1
- data/lib/httpx/request2.rb +14 -0
- data/lib/httpx/selector.rb +11 -7
- data/lib/httpx/version.rb +1 -1
- data/sig/selector.rbs +1 -0
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ddf7801add132a755b4ae9a069d5267251780577ca68398f92ca04788ea5ba
|
4
|
+
data.tar.gz: 17a8072343c029940262b14810d66744d7761e561c2f0f0c5bb892737690c761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf80ebdd6b1b767f0617e5f21c162d2beaacfb988d83061aebc2a4bbf4b7308ed7a693f2147cbc31cdee01f1dd4543087b4d57d241de61bdcf3e68d07525597
|
7
|
+
data.tar.gz: 176bfb2025dcf3039da7fc803a4abfada95d19a8221dfac746872f8806018b7b6b9b2c659ed6788183fe37bc661d7deb769094a9929b34534602bd7c4689ea01
|
data/doc/release_notes/0_15_0.md
CHANGED
@@ -41,4 +41,13 @@ A new timeout option, `settings_timeout`, is supported for the HTTP/2 handshake;
|
|
41
41
|
# if you want to change
|
42
42
|
HTTPX.with(timeout: {settings_timeout: 5})....
|
43
43
|
|
44
|
+
```
|
45
|
+
|
46
|
+
IDNA 2008 support is now possibly, by integrating [idnx](https://github.com/HoneyryderChuck/idnx) into your dependencies:
|
47
|
+
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
# in Gemfile
|
51
|
+
gem "httpx"
|
52
|
+
gem "idnx"
|
44
53
|
```
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# 0.15.1
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
Fixed HTTP/1 connection accounting on requests:
|
6
|
+
|
7
|
+
* when persistent, Connection: close will be set based on the request position on the batch against the allowed requests on the open connection.
|
8
|
+
* when not persistent, Connnection: close will be set on the last request of the batch, being the batch a subset based on allowed requests, or the whole of it.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# 0.15.2
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* Fixed cookie management for same-keys: before the fix, cookies with same-key, same-domain and same-path were all being sent in subsequent requests, which violates RFC 6265 - 5.4 . As of now, only the last valid cookie for a given key/domain/path will be kept, evicting the others.
|
6
|
+
|
7
|
+
## Chore
|
8
|
+
|
9
|
+
* debug logs were inserting ASCII code string wrappers, even when no color was set. It nonw only sends the plain string.
|
@@ -263,13 +263,24 @@ module HTTPX
|
|
263
263
|
request.chunk!
|
264
264
|
end
|
265
265
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
266
|
+
connection = if request.options.persistent
|
267
|
+
# when in a persistent connection, the request can't be at
|
268
|
+
# the edge of a renegotiation
|
269
|
+
if @requests.index(request) + 1 < @max_requests
|
270
|
+
"keep-alive"
|
271
|
+
else
|
272
|
+
"close"
|
273
|
+
end
|
271
274
|
else
|
272
|
-
"close"
|
275
|
+
# when it's not a persistent connection, it sets "Connection: close" always
|
276
|
+
# on the last request of the possible batch (either allowed max requests,
|
277
|
+
# or if smaller, the size of the batch itself)
|
278
|
+
requests_limit = [@max_requests, @requests.size].min
|
279
|
+
if request != @requests[requests_limit - 1]
|
280
|
+
"keep-alive"
|
281
|
+
else
|
282
|
+
"close"
|
283
|
+
end
|
273
284
|
end
|
274
285
|
|
275
286
|
{
|
data/lib/httpx/loggable.rb
CHANGED
@@ -20,7 +20,7 @@ module HTTPX
|
|
20
20
|
debug_stream = @options.debug
|
21
21
|
|
22
22
|
message = (+"" << msg.call << "\n")
|
23
|
-
message = "\e[#{COLORS[color]}m#{message}\e[0m" if debug_stream.respond_to?(:isatty) && debug_stream.isatty
|
23
|
+
message = "\e[#{COLORS[color]}m#{message}\e[0m" if color && debug_stream.respond_to?(:isatty) && debug_stream.isatty
|
24
24
|
debug_stream << message
|
25
25
|
end
|
26
26
|
|
data/lib/httpx/options.rb
CHANGED
@@ -144,7 +144,7 @@ module HTTPX
|
|
144
144
|
Array(value)
|
145
145
|
OUT
|
146
146
|
|
147
|
-
%
|
147
|
+
%i[
|
148
148
|
params form json body ssl http2_settings
|
149
149
|
request_class response_class headers_class request_body_class response_body_class connection_class
|
150
150
|
io fallback_protocol debug debug_level transport_options resolver_class resolver_options
|
@@ -171,6 +171,8 @@ module HTTPX
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def merge(other)
|
174
|
+
raise ArgumentError, "#{other.inspect} is not a valid set of options" unless other.respond_to?(:to_hash)
|
175
|
+
|
174
176
|
h2 = other.to_hash
|
175
177
|
return self if h2.empty?
|
176
178
|
|
@@ -43,8 +43,7 @@ module HTTPX
|
|
43
43
|
# Precedence: 1. longer path 2. older creation
|
44
44
|
(@name <=> other.name).nonzero? ||
|
45
45
|
(other.path.length <=> @path.length).nonzero? ||
|
46
|
-
(@created_at <=> other.created_at).nonzero?
|
47
|
-
@value <=> other.value
|
46
|
+
(@created_at <=> other.created_at).nonzero?
|
48
47
|
end
|
49
48
|
|
50
49
|
class << self
|
@@ -43,6 +43,10 @@ module HTTPX
|
|
43
43
|
|
44
44
|
c.path = path if path && c.path == "/"
|
45
45
|
|
46
|
+
# If the user agent receives a new cookie with the same cookie-name, domain-value, and path-value
|
47
|
+
# as a cookie that it has already stored, the existing cookie is evicted and replaced with the new cookie.
|
48
|
+
@cookies.delete_if { |ck| ck.name == c.name && ck.domain == c.domain && ck.path == c.path }
|
49
|
+
|
46
50
|
@cookies << c
|
47
51
|
end
|
48
52
|
|
data/lib/httpx/plugins/grpc.rb
CHANGED
data/lib/httpx/selector.rb
CHANGED
@@ -77,7 +77,7 @@ class HTTPX::Selector
|
|
77
77
|
|
78
78
|
break
|
79
79
|
else
|
80
|
-
@selectables
|
80
|
+
@selectables.concat(selectables)
|
81
81
|
end
|
82
82
|
rescue StandardError
|
83
83
|
@selectables = selectables if selectables
|
@@ -95,14 +95,18 @@ class HTTPX::Selector
|
|
95
95
|
retry
|
96
96
|
end
|
97
97
|
|
98
|
-
|
99
|
-
|
98
|
+
if writers
|
99
|
+
readers.each do |io|
|
100
|
+
yield io
|
100
101
|
|
101
|
-
|
102
|
-
|
103
|
-
|
102
|
+
# so that we don't yield 2 times
|
103
|
+
writers.delete(io)
|
104
|
+
end if readers
|
104
105
|
|
105
|
-
|
106
|
+
writers.each(&block)
|
107
|
+
else
|
108
|
+
readers.each(&block) if readers
|
109
|
+
end
|
106
110
|
end
|
107
111
|
|
108
112
|
def select_one(interval)
|
data/lib/httpx/version.rb
CHANGED
data/sig/selector.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -69,6 +69,10 @@ extra_rdoc_files:
|
|
69
69
|
- doc/release_notes/0_14_4.md
|
70
70
|
- doc/release_notes/0_14_5.md
|
71
71
|
- doc/release_notes/0_15_0.md
|
72
|
+
- doc/release_notes/0_15_1.md
|
73
|
+
- doc/release_notes/0_15_2.md
|
74
|
+
- doc/release_notes/0_15_3.md
|
75
|
+
- doc/release_notes/0_15_4.md
|
72
76
|
- doc/release_notes/0_1_0.md
|
73
77
|
- doc/release_notes/0_2_0.md
|
74
78
|
- doc/release_notes/0_2_1.md
|
@@ -117,6 +121,10 @@ files:
|
|
117
121
|
- doc/release_notes/0_14_4.md
|
118
122
|
- doc/release_notes/0_14_5.md
|
119
123
|
- doc/release_notes/0_15_0.md
|
124
|
+
- doc/release_notes/0_15_1.md
|
125
|
+
- doc/release_notes/0_15_2.md
|
126
|
+
- doc/release_notes/0_15_3.md
|
127
|
+
- doc/release_notes/0_15_4.md
|
120
128
|
- doc/release_notes/0_1_0.md
|
121
129
|
- doc/release_notes/0_2_0.md
|
122
130
|
- doc/release_notes/0_2_1.md
|
@@ -208,6 +216,7 @@ files:
|
|
208
216
|
- lib/httpx/punycode.rb
|
209
217
|
- lib/httpx/registry.rb
|
210
218
|
- lib/httpx/request.rb
|
219
|
+
- lib/httpx/request2.rb
|
211
220
|
- lib/httpx/resolver.rb
|
212
221
|
- lib/httpx/resolver/https.rb
|
213
222
|
- lib/httpx/resolver/native.rb
|
@@ -290,6 +299,7 @@ metadata:
|
|
290
299
|
changelog_uri: https://honeyryderchuck.gitlab.io/httpx/#release-notes
|
291
300
|
documentation_uri: https://honeyryderchuck.gitlab.io/httpx/rdoc/
|
292
301
|
source_code_uri: https://gitlab.com/honeyryderchuck/httpx
|
302
|
+
homepage_uri: https://honeyryderchuck.gitlab.io/httpx/
|
293
303
|
post_install_message:
|
294
304
|
rdoc_options: []
|
295
305
|
require_paths:
|