httpx 1.3.1 → 1.3.3
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/1_3_2.md +6 -0
- data/doc/release_notes/1_3_3.md +5 -0
- data/lib/httpx/adapters/webmock.rb +1 -1
- data/lib/httpx/plugins/proxy.rb +2 -0
- data/lib/httpx/request.rb +1 -1
- data/lib/httpx/session2.rb +1 -1
- data/lib/httpx/transcoder/body.rb +2 -0
- data/lib/httpx/transcoder/form.rb +2 -0
- data/lib/httpx/transcoder/json.rb +2 -0
- data/lib/httpx/transcoder/multipart/encoder.rb +6 -0
- data/lib/httpx/version.rb +1 -1
- data/sig/transcoder/multipart.rbs +2 -0
- metadata +7 -4
- data/lib/httpx/pool/synch_pool.rb +0 -93
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8829f986611d6b07d5c8b14ed0a51152e7f9303d01d1ec9469263f78843ce339
|
4
|
+
data.tar.gz: 8e55596dd065b9b3d352a0ad3173577556ea5bfb7963ea85287bb58d9018160b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b46a5f9f27b7571051fc95ef5d11d03cdaaa822cd08684ad1b1cf2605aacabc42ea1762f152303932bdd1e1f41c89447017ffcfaee8f995f04fdd908cbe69444
|
7
|
+
data.tar.gz: 57c5407473eb1fa8bbe7e4f3e3fef3288e8a8074776378a130894e72931833acf7bd30cd235f904fcd96cda810a3ec7118a3de9a66b28124ffd18de6b2fc1c42
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# 1.3.2
|
2
|
+
|
3
|
+
## Bugfixes
|
4
|
+
|
5
|
+
* Prevent `NoMethodError` in an edge case when the `:proxy` plugin is autoloaded via env vars and webmock adapter are used in tandem, and a real request fails.
|
6
|
+
* raise invalid uri error if passed request uri does not contain the host part (ex: `"https:/get"`)
|
data/lib/httpx/plugins/proxy.rb
CHANGED
data/lib/httpx/request.rb
CHANGED
data/lib/httpx/session2.rb
CHANGED
@@ -18,6 +18,12 @@ module HTTPX
|
|
18
18
|
"multipart/form-data; boundary=#{@boundary}"
|
19
19
|
end
|
20
20
|
|
21
|
+
def to_s
|
22
|
+
read
|
23
|
+
ensure
|
24
|
+
rewind
|
25
|
+
end
|
26
|
+
|
21
27
|
def read(length = nil, outbuf = nil)
|
22
28
|
data = String(outbuf).clear.force_encoding(Encoding::BINARY) if outbuf
|
23
29
|
data ||= "".b
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2
|
@@ -146,6 +146,8 @@ extra_rdoc_files:
|
|
146
146
|
- doc/release_notes/1_2_6.md
|
147
147
|
- doc/release_notes/1_3_0.md
|
148
148
|
- doc/release_notes/1_3_1.md
|
149
|
+
- doc/release_notes/1_3_2.md
|
150
|
+
- doc/release_notes/1_3_3.md
|
149
151
|
files:
|
150
152
|
- LICENSE.txt
|
151
153
|
- README.md
|
@@ -263,6 +265,8 @@ files:
|
|
263
265
|
- doc/release_notes/1_2_6.md
|
264
266
|
- doc/release_notes/1_3_0.md
|
265
267
|
- doc/release_notes/1_3_1.md
|
268
|
+
- doc/release_notes/1_3_2.md
|
269
|
+
- doc/release_notes/1_3_3.md
|
266
270
|
- lib/httpx.rb
|
267
271
|
- lib/httpx/adapters/datadog.rb
|
268
272
|
- lib/httpx/adapters/faraday.rb
|
@@ -335,7 +339,6 @@ files:
|
|
335
339
|
- lib/httpx/plugins/webdav.rb
|
336
340
|
- lib/httpx/pmatch_extensions.rb
|
337
341
|
- lib/httpx/pool.rb
|
338
|
-
- lib/httpx/pool/synch_pool.rb
|
339
342
|
- lib/httpx/punycode.rb
|
340
343
|
- lib/httpx/request.rb
|
341
344
|
- lib/httpx/request/body.rb
|
@@ -480,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
480
483
|
- !ruby/object:Gem::Version
|
481
484
|
version: '0'
|
482
485
|
requirements: []
|
483
|
-
rubygems_version: 3.
|
486
|
+
rubygems_version: 3.5.3
|
484
487
|
signing_key:
|
485
488
|
specification_version: 4
|
486
489
|
summary: HTTPX, to the future, and beyond
|
@@ -1,93 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "thread"
|
4
|
-
|
5
|
-
module HTTPX
|
6
|
-
class SynchPool < Pool
|
7
|
-
def initialize(options)
|
8
|
-
super
|
9
|
-
|
10
|
-
@connections = ConnectionStore.new(options)
|
11
|
-
end
|
12
|
-
|
13
|
-
# TODO: #wrap
|
14
|
-
def find_or_new_connection(uri, options, &blk)
|
15
|
-
@connections.find_or_new(uri, options) do |new_conn|
|
16
|
-
catch(:coalesced) do
|
17
|
-
init_connection(new_conn, options)
|
18
|
-
blk.call(new_conn) if blk
|
19
|
-
new_conn
|
20
|
-
end
|
21
|
-
end
|
22
|
-
find_connection(uri, options) || new_connection(uri, options, &blk)
|
23
|
-
end
|
24
|
-
|
25
|
-
class ConnectionManager
|
26
|
-
include Enumerable
|
27
|
-
|
28
|
-
def initialize(limit = 3)
|
29
|
-
@connections = []
|
30
|
-
@used = 0
|
31
|
-
@limit = limit
|
32
|
-
end
|
33
|
-
|
34
|
-
def each(*args, &blk)
|
35
|
-
@connections.each(*args, &blk)
|
36
|
-
end
|
37
|
-
|
38
|
-
def find_or_new(uri, options, &blk)
|
39
|
-
raise "over limit" if @used >= @limit
|
40
|
-
|
41
|
-
@used += 1
|
42
|
-
conn = @connections.find do |connection|
|
43
|
-
connection.match?(uri, options)
|
44
|
-
end
|
45
|
-
|
46
|
-
if conn
|
47
|
-
@connections.delete(conn)
|
48
|
-
else
|
49
|
-
conn = options.connection_class.new(uri, options)
|
50
|
-
blk[conn]
|
51
|
-
end
|
52
|
-
|
53
|
-
conn
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
class ConnectionStore
|
58
|
-
include Enumerable
|
59
|
-
|
60
|
-
def initialize(options)
|
61
|
-
@connections = Hash.new { |hs, k| hs[k] ||= ConnectionManager.new }
|
62
|
-
@conn_mtx = Thread::Mutex.new
|
63
|
-
@conn_waiter = ConditionVariable.new
|
64
|
-
@timeout = Float(options.fetch(:pool_timeout, 5))
|
65
|
-
end
|
66
|
-
|
67
|
-
def each(&block)
|
68
|
-
return enum_for(__meth__) unless block
|
69
|
-
|
70
|
-
@conn_mtx.synchronize do
|
71
|
-
@connections.each_value do |conns|
|
72
|
-
conns.each(&block)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def find_or_new(uri, options, &blk)
|
78
|
-
@connections[uri.origin].find_or_new(uri, options, &blk)
|
79
|
-
end
|
80
|
-
|
81
|
-
# def <<(conn)
|
82
|
-
# @conn_mtx.synchronize do
|
83
|
-
# origin, conns = @connections.find { |_orig, _| conn.origins.include?(origin) }
|
84
|
-
# (conns || @connections[conn.origin.to_s]) << conn
|
85
|
-
# end
|
86
|
-
# end
|
87
|
-
|
88
|
-
def empty?
|
89
|
-
@conn_mtx.synchronize { super }
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|