faraday-net_http_persistent 1.1.0 → 1.2.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/lib/faraday/adapter/net_http_persistent.rb +20 -1
- data/lib/faraday/net_http_persistent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bc1f8930b55722004909277859a02d2b792fb7efdd09381a852c06085eeb7f
|
4
|
+
data.tar.gz: 7ad77ee2a562d6479e57c361366ab3753e5f32e179839c00bff89232dce4d3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62fd182c8b193d450544f3d655b87f01a552fe6845e3f67094b1d0f5b94904713ed0f11ea185af40a7bd170c4cef69adad69e1cf4982e7a5b2eedb23de7e12bf
|
7
|
+
data.tar.gz: d6c37fe53505c0bf528b4451b9494d4265f2e37e23e38967e18c7c65d92b5c6c9bbc8fe9c2a8606e555a356085b543750f8c72449e9344acb3feebbb903a7d78
|
data/README.md
CHANGED
@@ -62,9 +62,9 @@ The gem is available as open source under the terms of the [MIT License][mit-lic
|
|
62
62
|
|
63
63
|
This project is intended to be a safe, welcoming space for collaboration.
|
64
64
|
Everyone interacting in the Faraday::Http project’s codebases, issue trackers,
|
65
|
-
chat rooms and mailing lists is expected to follow the [code of conduct].
|
65
|
+
chat rooms and mailing lists is expected to follow the [code of conduct][code-of-conduct].
|
66
66
|
|
67
|
-
[code-of-conduct]: https://github.com/lostisland/faraday-http/blob/
|
67
|
+
[code-of-conduct]: https://github.com/lostisland/faraday-http/blob/main/CODE_OF_CONDUCT.md
|
68
68
|
[covenant]: http://contributor-covenant.org
|
69
69
|
[faraday]: https://github.com/lostisland/faraday
|
70
70
|
[faraday-website]: https://lostisland.github.io/faraday
|
@@ -50,7 +50,26 @@ module Faraday
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def perform_request(http, env)
|
53
|
-
|
53
|
+
if env[:request].stream_response?
|
54
|
+
size = 0
|
55
|
+
yielded = false
|
56
|
+
|
57
|
+
http_response = http.request(env[:url], create_request(env)) do |response|
|
58
|
+
response.read_body do |chunk|
|
59
|
+
if chunk.bytesize.positive? || size.positive?
|
60
|
+
yielded = true
|
61
|
+
size += chunk.bytesize
|
62
|
+
env[:request].on_data.call(chunk, size)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
env[:request].on_data.call(+"", 0) unless yielded
|
68
|
+
http_response.body = nil
|
69
|
+
http_response
|
70
|
+
else
|
71
|
+
http.request(env[:url], create_request(env))
|
72
|
+
end
|
54
73
|
rescue Errno::ETIMEDOUT, Net::OpenTimeout => e
|
55
74
|
raise Faraday::TimeoutError, e
|
56
75
|
rescue Net::HTTP::Persistent::Error => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-net_http_persistent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Rogers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http-persistent
|