httpx 0.19.5 → 0.19.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dbbe59cf004c889830daa1a45b0111eb4e04e7447fc0e94bca9ae7041d99770
4
- data.tar.gz: 95acfba594d42b96a41e0d18d682f5873cbe57e1e394d62d76ce7be1463741ad
3
+ metadata.gz: 832389a759da52da8b345ffa687a9704b3ec3465a936664d3cab2247586a51de
4
+ data.tar.gz: 16e4bda290c1631c64f263daf416aec4a4858b7404a3570f229c800da1ca8be2
5
5
  SHA512:
6
- metadata.gz: 401ee8e3e4c1eb92a454a9debb73d3f1c7d1f119ba757e5a2534b4d2b7a39c2608b7ef91f95fc74ec50dfa7db1faa25aadf4b57d2e8c9f58f5c65e01f98dc234
7
- data.tar.gz: 937d4b05a7ee6b3da3cdce1e98e3c389dc3eed82cc29a278dfb3d7c0d7907e795421caaec00f2a95112d99deb13fcfe1d81a70c291d0f00dd862021cbe036583
6
+ metadata.gz: 73816d590b2990b61c4d67dbade348fe7f7ab93e4996a7a4585b4ef895f6410f785c3e85d6f73d621aa2367f0a42add8344502cafd78312f056940f339be4c34
7
+ data.tar.gz: 3cb533d7d796f63bc869e8213c0c03b8d290698f8ee3c07affb9b29b79e60e802baa25ca78d7ddf9e7e530ccfc970490a69029878399522c48b8f7bc43222a99
@@ -0,0 +1,5 @@
1
+ # 0.19.6
2
+
3
+ ## Bugfixes
4
+
5
+ * fixed the root cause of the `faraday` adapter failing when used alongside the `webmock` integration.
@@ -99,33 +99,31 @@ module Faraday
99
99
  end
100
100
  end
101
101
 
102
- class Session < ::HTTPX::Session
103
- plugin(:compression)
104
- plugin(:persistent)
105
-
106
- module ReasonPlugin
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 self.load_dependencies(*)
109
- require "webrick"
114
+ def reason
115
+ WEBrick::HTTPStatus::StatusMessage.fetch(@status)
110
116
  end
111
117
  else
112
- def self.load_dependencies(*)
113
- require "net/http/status"
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
- plugin(ReasonPlugin)
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 = @session.with(options_from_env(env))
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
- @session = Session.new(options)
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 = @session.with(options_from_env(env))
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTPX
4
- VERSION = "0.19.5"
4
+ VERSION = "0.19.6"
5
5
  end
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.5
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-03-30 00:00:00.000000000 Z
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