httpx 1.3.1 → 1.3.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/1_3_2.md +6 -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/version.rb +1 -1
- metadata +5 -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: e417c7a6d7564807d040374d9174d5b1fd3945ce924062397fdc0ad95d12bd31
|
|
4
|
+
data.tar.gz: bf001578d74624abc4d05e74563c2d9a5388cbd6315cd29fb0cf176d2e4e01e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc88e4afa96c336a79ba37e6fb35521cc189db0e2981bad0d5354253f2f55e320e951656da4cc59ad5baab709ef933ed98c52ff12b116c2a9021d039e42e3db8
|
|
7
|
+
data.tar.gz: 2cbdcc54076a34b66a413b6aa380a25e3243cedd98882774ac02fc3f345178197b01097b2b615bf174d0e0affe1b9d4dd03881305b7c16c33183dc77c27f1f9d
|
|
@@ -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
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.2
|
|
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-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: http-2
|
|
@@ -146,6 +146,7 @@ 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
|
|
149
150
|
files:
|
|
150
151
|
- LICENSE.txt
|
|
151
152
|
- README.md
|
|
@@ -263,6 +264,7 @@ files:
|
|
|
263
264
|
- doc/release_notes/1_2_6.md
|
|
264
265
|
- doc/release_notes/1_3_0.md
|
|
265
266
|
- doc/release_notes/1_3_1.md
|
|
267
|
+
- doc/release_notes/1_3_2.md
|
|
266
268
|
- lib/httpx.rb
|
|
267
269
|
- lib/httpx/adapters/datadog.rb
|
|
268
270
|
- lib/httpx/adapters/faraday.rb
|
|
@@ -335,7 +337,6 @@ files:
|
|
|
335
337
|
- lib/httpx/plugins/webdav.rb
|
|
336
338
|
- lib/httpx/pmatch_extensions.rb
|
|
337
339
|
- lib/httpx/pool.rb
|
|
338
|
-
- lib/httpx/pool/synch_pool.rb
|
|
339
340
|
- lib/httpx/punycode.rb
|
|
340
341
|
- lib/httpx/request.rb
|
|
341
342
|
- lib/httpx/request/body.rb
|
|
@@ -480,7 +481,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
480
481
|
- !ruby/object:Gem::Version
|
|
481
482
|
version: '0'
|
|
482
483
|
requirements: []
|
|
483
|
-
rubygems_version: 3.
|
|
484
|
+
rubygems_version: 3.5.3
|
|
484
485
|
signing_key:
|
|
485
486
|
specification_version: 4
|
|
486
487
|
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
|