httpx 0.22.1 → 0.22.2
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/0_22_2.md +5 -0
- data/lib/httpx/adapters/sentry.rb +5 -1
- data/lib/httpx/plugins/digest_authentication.rb +2 -0
- data/lib/httpx/plugins/expect.rb +3 -2
- data/lib/httpx/plugins/follow_redirects.rb +1 -0
- data/lib/httpx/plugins/ntlm_authentication.rb +2 -0
- data/lib/httpx/plugins/proxy/http.rb +4 -2
- data/lib/httpx/plugins/rate_limiter.rb +2 -0
- data/lib/httpx/plugins/upgrade.rb +3 -1
- data/lib/httpx/plugins/webdav.rb +2 -0
- data/lib/httpx/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373c83e6252fb0439bfe307cacc18514741c9b8eaa1b9d055e1da59015c7a8f3
|
4
|
+
data.tar.gz: bc20567c842a6b6bd7d450fc6edd5ee1eb509940ffddab643a0c6a3b8ad48522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff4fd33b7614c410fb30b4916ad430fbf2091d43d6bec5dfa3784564a4824491baa89f33e491db6a4a76c5cf8f4e9e07e2d5192a1214ee0f8283e345b3b1387e
|
7
|
+
data.tar.gz: 4da51a3015ef7a7f32f8e24b7e14324acda8c6a735cd3038e0a7a224376c60775ed533ee936ba58ad51639adcc16906a8ef8b637d9ef84733ac4546ed4ddd7de
|
@@ -63,7 +63,11 @@ module HTTPX::Plugins
|
|
63
63
|
|
64
64
|
request_info = extract_request_info(req)
|
65
65
|
sentry_span.set_description("#{request_info[:method]} #{request_info[:url]}")
|
66
|
-
|
66
|
+
if res.is_a?(HTTPX::ErrorResponse)
|
67
|
+
sentry_span.set_data(:error, res.message)
|
68
|
+
else
|
69
|
+
sentry_span.set_data(:status, res.status)
|
70
|
+
end
|
67
71
|
sentry_span.set_timestamp(::Sentry.utc_now.to_f)
|
68
72
|
end
|
69
73
|
|
@@ -46,6 +46,8 @@ module HTTPX
|
|
46
46
|
|
47
47
|
probe_response = wrap { super(request).first }
|
48
48
|
|
49
|
+
return probe_response unless probe_response.is_a?(Response)
|
50
|
+
|
49
51
|
if probe_response.status == 401 && digest.can_authenticate?(probe_response.headers["www-authenticate"])
|
50
52
|
request.transition(:idle)
|
51
53
|
request.headers["authorization"] = digest.authenticate(request, probe_response.headers["www-authenticate"])
|
data/lib/httpx/plugins/expect.rb
CHANGED
@@ -50,7 +50,8 @@ module HTTPX
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def response=(response)
|
53
|
-
if response
|
53
|
+
if response.is_a?(Response) &&
|
54
|
+
response.status == 100 &&
|
54
55
|
!@headers.key?("expect") &&
|
55
56
|
(@state == :body || @state == :done)
|
56
57
|
|
@@ -92,7 +93,7 @@ module HTTPX
|
|
92
93
|
response = @responses.delete(request)
|
93
94
|
return unless response
|
94
95
|
|
95
|
-
if response.status == 417 && request.headers.key?("expect")
|
96
|
+
if response.is_a?(Response) && response.status == 417 && request.headers.key?("expect")
|
96
97
|
response.close
|
97
98
|
request.headers.delete("expect")
|
98
99
|
request.transition(:idle)
|
@@ -44,6 +44,7 @@ module HTTPX
|
|
44
44
|
|
45
45
|
max_redirects = redirect_request.max_redirects
|
46
46
|
|
47
|
+
return response unless response.is_a?(Response)
|
47
48
|
return response unless REDIRECT_STATUS.include?(response.status) && response.headers.key?("location")
|
48
49
|
return response unless max_redirects.positive?
|
49
50
|
|
@@ -39,6 +39,8 @@ module HTTPX
|
|
39
39
|
request.headers["authorization"] = ntlm.negotiate
|
40
40
|
probe_response = wrap { super(request).first }
|
41
41
|
|
42
|
+
return probe_response unless probe_response.is_a?(Response)
|
43
|
+
|
42
44
|
if probe_response.status == 401 && ntlm.can_authenticate?(probe_response.headers["www-authenticate"])
|
43
45
|
request.transition(:idle)
|
44
46
|
request.headers["authorization"] = ntlm.authenticate(request, probe_response.headers["www-authenticate"])
|
@@ -23,6 +23,7 @@ module HTTPX
|
|
23
23
|
response = super
|
24
24
|
|
25
25
|
if response &&
|
26
|
+
response.is_a?(Response) &&
|
26
27
|
response.status == 407 &&
|
27
28
|
!request.headers.key?("proxy-authorization") &&
|
28
29
|
response.headers.key?("proxy-authenticate")
|
@@ -113,13 +114,14 @@ module HTTPX
|
|
113
114
|
|
114
115
|
def __http_on_connect(request, response)
|
115
116
|
@inflight -= 1
|
116
|
-
if response.status == 200
|
117
|
+
if response.is_a?(Response) && response.status == 200
|
117
118
|
req = @pending.first
|
118
119
|
request_uri = req.uri
|
119
120
|
@io = ProxySSL.new(@io, request_uri, @options)
|
120
121
|
transition(:connected)
|
121
122
|
throw(:called)
|
122
|
-
elsif response.
|
123
|
+
elsif response.is_a?(Response) &&
|
124
|
+
response.status == 407 &&
|
123
125
|
!request.headers.key?("proxy-authorization") &&
|
124
126
|
@options.proxy.can_authenticate?(response.headers["proxy-authenticate"])
|
125
127
|
|
@@ -35,7 +35,9 @@ module HTTPX
|
|
35
35
|
response = super
|
36
36
|
|
37
37
|
if response
|
38
|
-
return response unless response.
|
38
|
+
return response unless response.is_a?(Response)
|
39
|
+
|
40
|
+
return response unless response.headers.key?("upgrade")
|
39
41
|
|
40
42
|
upgrade_protocol = response.headers["upgrade"].split(/ *, */).first
|
41
43
|
|
data/lib/httpx/plugins/webdav.rb
CHANGED
data/lib/httpx/version.rb
CHANGED
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: 0.22.
|
4
|
+
version: 0.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
@@ -90,6 +90,7 @@ extra_rdoc_files:
|
|
90
90
|
- doc/release_notes/0_21_1.md
|
91
91
|
- doc/release_notes/0_22_0.md
|
92
92
|
- doc/release_notes/0_22_1.md
|
93
|
+
- doc/release_notes/0_22_2.md
|
93
94
|
- doc/release_notes/0_2_0.md
|
94
95
|
- doc/release_notes/0_2_1.md
|
95
96
|
- doc/release_notes/0_3_0.md
|
@@ -172,6 +173,7 @@ files:
|
|
172
173
|
- doc/release_notes/0_21_1.md
|
173
174
|
- doc/release_notes/0_22_0.md
|
174
175
|
- doc/release_notes/0_22_1.md
|
176
|
+
- doc/release_notes/0_22_2.md
|
175
177
|
- doc/release_notes/0_2_0.md
|
176
178
|
- doc/release_notes/0_2_1.md
|
177
179
|
- doc/release_notes/0_3_0.md
|