httpx 0.22.0 → 0.22.1
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_22_1.md +11 -0
- data/lib/httpx/adapters/faraday.rb +2 -1
- data/lib/httpx/connection.rb +8 -2
- data/lib/httpx/errors.rb +2 -0
- data/lib/httpx/io/tcp.rb +7 -2
- data/lib/httpx/plugins/follow_redirects.rb +6 -0
- data/lib/httpx/plugins/retries.rb +1 -0
- data/lib/httpx/plugins/stream.rb +0 -2
- data/lib/httpx/request.rb +1 -1
- data/lib/httpx/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5485fee0a9dde3dee5e6c0dad232f00296adfe502ec5b3e7d86e910e4325a53
|
4
|
+
data.tar.gz: 4b31eb7319c64d6522055e1bfc3f436433b2289cff8fcbac1a82fe2c2b356156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51ffd6a54a0b04486be732678a3a69673651777dd746950f95122493a8d580c91bf40cdbb82b6555ad01d2ccbf2bc153470ea0218a427ff7654106141c6bb4a4
|
7
|
+
data.tar.gz: b3e51d51a66cc01db0870200bdf0a4427e0c749f518153bb39aa7cd18fe53d0dd4c3cb90d56c9c6e676e36aacd8edc51f005ec5e3f31e821e1ef500c81427602
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# 0.22.1
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* `:retries` plugin: fix `HTTPX::Response#response to point to last possible response in the redirection chain.
|
6
|
+
* `:stream` plugin: Make `HTTPX::Session#request` public (as it is inn the main class) .
|
7
|
+
* return 100 responses if the request didn't specifically ask for "100-continue" negotiation (via the "expect" header).
|
8
|
+
|
9
|
+
## Improvements
|
10
|
+
|
11
|
+
Wrap low-level socket errors in a `HTTPX::ConnectionError` exception.
|
data/lib/httpx/connection.rb
CHANGED
@@ -526,8 +526,14 @@ module HTTPX
|
|
526
526
|
Errno::EHOSTUNREACH,
|
527
527
|
Errno::EINVAL,
|
528
528
|
Errno::ENETUNREACH,
|
529
|
-
Errno::EPIPE
|
530
|
-
|
529
|
+
Errno::EPIPE => e
|
530
|
+
# connect errors, exit gracefully
|
531
|
+
error = ConnectionError.new(e.message)
|
532
|
+
error.set_backtrace(e.backtrace)
|
533
|
+
handle_error(error)
|
534
|
+
@state = :closed
|
535
|
+
emit(:close)
|
536
|
+
rescue TLSError => e
|
531
537
|
# connect errors, exit gracefully
|
532
538
|
handle_error(e)
|
533
539
|
@state = :closed
|
data/lib/httpx/errors.rb
CHANGED
data/lib/httpx/io/tcp.rb
CHANGED
@@ -74,8 +74,13 @@ module HTTPX
|
|
74
74
|
try_connect
|
75
75
|
rescue Errno::ECONNREFUSED,
|
76
76
|
Errno::EADDRNOTAVAIL,
|
77
|
-
Errno::EHOSTUNREACH
|
78
|
-
|
77
|
+
Errno::EHOSTUNREACH,
|
78
|
+
SocketError => e
|
79
|
+
if @ip_index <= 0
|
80
|
+
error = ConnectionError.new(e.message)
|
81
|
+
error.set_backtrace(e.backtrace)
|
82
|
+
raise error
|
83
|
+
end
|
79
84
|
|
80
85
|
log { "failed connecting to #{@ip} (#{e.message}), trying next..." }
|
81
86
|
@ip_index -= 1
|
data/lib/httpx/plugins/stream.rb
CHANGED
data/lib/httpx/request.rb
CHANGED
@@ -86,7 +86,7 @@ module HTTPX
|
|
86
86
|
def response=(response)
|
87
87
|
return unless response
|
88
88
|
|
89
|
-
if response.is_a?(Response) && response.status == 100
|
89
|
+
if response.is_a?(Response) && response.status == 100 && @headers.key?("expect")
|
90
90
|
@informational_status = response.status
|
91
91
|
return
|
92
92
|
end
|
data/lib/httpx/version.rb
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.22.
|
4
|
+
version: 0.22.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -89,6 +89,7 @@ extra_rdoc_files:
|
|
89
89
|
- doc/release_notes/0_21_0.md
|
90
90
|
- doc/release_notes/0_21_1.md
|
91
91
|
- doc/release_notes/0_22_0.md
|
92
|
+
- doc/release_notes/0_22_1.md
|
92
93
|
- doc/release_notes/0_2_0.md
|
93
94
|
- doc/release_notes/0_2_1.md
|
94
95
|
- doc/release_notes/0_3_0.md
|
@@ -170,6 +171,7 @@ files:
|
|
170
171
|
- doc/release_notes/0_21_0.md
|
171
172
|
- doc/release_notes/0_21_1.md
|
172
173
|
- doc/release_notes/0_22_0.md
|
174
|
+
- doc/release_notes/0_22_1.md
|
173
175
|
- doc/release_notes/0_2_0.md
|
174
176
|
- doc/release_notes/0_2_1.md
|
175
177
|
- doc/release_notes/0_3_0.md
|