httpx 0.19.5 → 0.19.6
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_19_6.md +5 -0
- data/lib/httpx/adapters/faraday.rb +24 -25
- 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: 832389a759da52da8b345ffa687a9704b3ec3465a936664d3cab2247586a51de
|
4
|
+
data.tar.gz: 16e4bda290c1631c64f263daf416aec4a4858b7404a3570f229c800da1ca8be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73816d590b2990b61c4d67dbade348fe7f7ab93e4996a7a4585b4ef895f6410f785c3e85d6f73d621aa2367f0a42add8344502cafd78312f056940f339be4c34
|
7
|
+
data.tar.gz: 3cb533d7d796f63bc869e8213c0c03b8d290698f8ee3c07affb9b29b79e60e802baa25ca78d7ddf9e7e530ccfc970490a69029878399522c48b8f7bc43222a99
|
@@ -99,33 +99,31 @@ module Faraday
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
module ReasonPlugin
|
103
|
+
if RUBY_VERSION < "2.5"
|
104
|
+
def self.load_dependencies(*)
|
105
|
+
require "webrick"
|
106
|
+
end
|
107
|
+
else
|
108
|
+
def self.load_dependencies(*)
|
109
|
+
require "net/http/status"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
module ResponseMethods
|
107
113
|
if RUBY_VERSION < "2.5"
|
108
|
-
def
|
109
|
-
|
114
|
+
def reason
|
115
|
+
WEBrick::HTTPStatus::StatusMessage.fetch(@status)
|
110
116
|
end
|
111
117
|
else
|
112
|
-
def
|
113
|
-
|
114
|
-
end
|
115
|
-
end
|
116
|
-
module ResponseMethods
|
117
|
-
if RUBY_VERSION < "2.5"
|
118
|
-
def reason
|
119
|
-
WEBrick::HTTPStatus::StatusMessage.fetch(@status)
|
120
|
-
end
|
121
|
-
else
|
122
|
-
def reason
|
123
|
-
Net::HTTP::STATUS_CODES.fetch(@status)
|
124
|
-
end
|
118
|
+
def reason
|
119
|
+
Net::HTTP::STATUS_CODES.fetch(@status)
|
125
120
|
end
|
126
121
|
end
|
127
122
|
end
|
128
|
-
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.session
|
126
|
+
@session ||= ::HTTPX.plugin(:compression).plugin(:persistent).plugin(ReasonPlugin)
|
129
127
|
end
|
130
128
|
|
131
129
|
class ParallelManager
|
@@ -161,7 +159,6 @@ module Faraday
|
|
161
159
|
include RequestMixin
|
162
160
|
|
163
161
|
def initialize
|
164
|
-
@session = Session.new
|
165
162
|
@handlers = []
|
166
163
|
end
|
167
164
|
|
@@ -174,7 +171,7 @@ module Faraday
|
|
174
171
|
def run
|
175
172
|
env = @handlers.last.env
|
176
173
|
|
177
|
-
session =
|
174
|
+
session = HTTPX.session.with(options_from_env(env))
|
178
175
|
session = session.plugin(:proxy).with(proxy: { uri: env.request.proxy }) if env.request.proxy
|
179
176
|
session = session.plugin(OnDataPlugin) if env.request.stream_response?
|
180
177
|
|
@@ -205,7 +202,7 @@ module Faraday
|
|
205
202
|
|
206
203
|
def initialize(app, options = {})
|
207
204
|
super(app)
|
208
|
-
@
|
205
|
+
@session_options = options
|
209
206
|
end
|
210
207
|
|
211
208
|
def call(env)
|
@@ -221,7 +218,9 @@ module Faraday
|
|
221
218
|
return handler
|
222
219
|
end
|
223
220
|
|
224
|
-
session =
|
221
|
+
session = HTTPX.session
|
222
|
+
session = session.with(@session_options) unless @session_options.empty?
|
223
|
+
session = session.with(options_from_env(env))
|
225
224
|
session = session.plugin(:proxy).with(proxy: { uri: env.request.proxy }) if env.request.proxy
|
226
225
|
session = session.plugin(OnDataPlugin) if env.request.stream_response?
|
227
226
|
|
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.19.
|
4
|
+
version: 0.19.6
|
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-
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2-next
|
@@ -76,6 +76,7 @@ extra_rdoc_files:
|
|
76
76
|
- doc/release_notes/0_19_3.md
|
77
77
|
- doc/release_notes/0_19_4.md
|
78
78
|
- doc/release_notes/0_19_5.md
|
79
|
+
- doc/release_notes/0_19_6.md
|
79
80
|
- doc/release_notes/0_1_0.md
|
80
81
|
- doc/release_notes/0_2_0.md
|
81
82
|
- doc/release_notes/0_2_1.md
|
@@ -145,6 +146,7 @@ files:
|
|
145
146
|
- doc/release_notes/0_19_3.md
|
146
147
|
- doc/release_notes/0_19_4.md
|
147
148
|
- doc/release_notes/0_19_5.md
|
149
|
+
- doc/release_notes/0_19_6.md
|
148
150
|
- doc/release_notes/0_1_0.md
|
149
151
|
- doc/release_notes/0_2_0.md
|
150
152
|
- doc/release_notes/0_2_1.md
|