httpx 1.3.3 → 1.3.4
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_3.md +1 -1
- data/doc/release_notes/1_3_4.md +6 -0
- data/lib/httpx/response/body.rb +12 -1
- data/lib/httpx/transcoder/multipart/encoder.rb +3 -1
- data/lib/httpx/version.rb +1 -1
- data/sig/response/body.rbs +2 -2
- data/sig/response/buffer.rbs +1 -1
- data/sig/transcoder/multipart.rbs +3 -3
- 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: 59239a38c693a32e279f32e5f153f606fdc83e0cdce02e6079947cc8f8d6e0d0
|
4
|
+
data.tar.gz: c386fbdd0409186f50390a2379c3945add29a7cafac805bbd0c780992e933437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d142fdfe649e0447f3043e5eebd52776c71c44c4b141607b061895c520e32a5d1da0c5c678c6fd6cdb9f572e1d3c43165d8c26bf006420c2b89ce66c547c986
|
7
|
+
data.tar.gz: 77435864f6afd01fdb7fbc8e1019928411a50032c11751220062f1fff804355d0220823f18cbef430e47bc26f3c28fab826513a242222ccdb003eae949a41b97
|
data/doc/release_notes/1_3_3.md
CHANGED
data/lib/httpx/response/body.rb
CHANGED
@@ -17,12 +17,23 @@ module HTTPX
|
|
17
17
|
@headers = response.headers
|
18
18
|
@options = options
|
19
19
|
@window_size = options.window_size
|
20
|
-
@encoding = response.content_type.charset || Encoding::BINARY
|
21
20
|
@encodings = []
|
22
21
|
@length = 0
|
23
22
|
@buffer = nil
|
24
23
|
@reader = nil
|
25
24
|
@state = :idle
|
25
|
+
|
26
|
+
# initialize response encoding
|
27
|
+
@encoding = if (enc = response.content_type.charset)
|
28
|
+
begin
|
29
|
+
Encoding.find(enc)
|
30
|
+
rescue ArgumentError
|
31
|
+
Encoding::BINARY
|
32
|
+
end
|
33
|
+
else
|
34
|
+
Encoding::BINARY
|
35
|
+
end
|
36
|
+
|
26
37
|
initialize_inflaters
|
27
38
|
end
|
28
39
|
|
@@ -35,7 +35,9 @@ module HTTPX
|
|
35
35
|
|
36
36
|
def rewind
|
37
37
|
form = @form.each_with_object([]) do |(key, val), aux|
|
38
|
-
val
|
38
|
+
if val.respond_to?(:path) && val.respond_to?(:reopen) && val.respond_to?(:closed?) && val.closed?
|
39
|
+
val = val.reopen(val.path, File::RDONLY)
|
40
|
+
end
|
39
41
|
val.rewind if val.respond_to?(:rewind)
|
40
42
|
aux << [key, val]
|
41
43
|
end
|
data/lib/httpx/version.rb
CHANGED
data/sig/response/body.rbs
CHANGED
data/sig/response/buffer.rbs
CHANGED
@@ -5,7 +5,7 @@ module HTTPX
|
|
5
5
|
@encoding: Encoding
|
6
6
|
@buffer: StringIO | Tempfile
|
7
7
|
|
8
|
-
def initialize: (threshold_size: Integer, ?bytesize: Integer, ?encoding: Encoding
|
8
|
+
def initialize: (threshold_size: Integer, ?bytesize: Integer, ?encoding: Encoding) -> void
|
9
9
|
|
10
10
|
def size: () -> Integer
|
11
11
|
|
@@ -9,7 +9,7 @@ module HTTPX
|
|
9
9
|
|
10
10
|
MULTIPART_VALUE_COND: ^(_Reader | record_multipart_value value) -> bool
|
11
11
|
|
12
|
-
type multipart_value = string | Pathname | File | _Reader
|
12
|
+
type multipart_value = string | Pathname | File | Tempfile | _Reader
|
13
13
|
|
14
14
|
type record_multipart_value = { content_type: String, filename: String, body: multipart_value } |
|
15
15
|
{ content_type: String, body: multipart_value }
|
@@ -83,13 +83,13 @@ module HTTPX
|
|
83
83
|
|
84
84
|
module Part
|
85
85
|
def self?.call: [U] (Object & _MultipartInput multipart_input) -> [U, String, String]
|
86
|
-
| (
|
86
|
+
| (multipart_nested_value value) -> ([StringIO, String, String?] | [File | Tempfile, String, String])
|
87
87
|
end
|
88
88
|
|
89
89
|
module MimeTypeDetector
|
90
90
|
DEFAULT_MIMETYPE: String
|
91
91
|
|
92
|
-
def self?.call: (::IO file, String filename) -> String?
|
92
|
+
def self?.call: (::IO | Tempfile file, String filename) -> String?
|
93
93
|
end
|
94
94
|
end
|
95
95
|
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: 1.3.
|
4
|
+
version: 1.3.4
|
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-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2
|
@@ -148,6 +148,7 @@ extra_rdoc_files:
|
|
148
148
|
- doc/release_notes/1_3_1.md
|
149
149
|
- doc/release_notes/1_3_2.md
|
150
150
|
- doc/release_notes/1_3_3.md
|
151
|
+
- doc/release_notes/1_3_4.md
|
151
152
|
files:
|
152
153
|
- LICENSE.txt
|
153
154
|
- README.md
|
@@ -267,6 +268,7 @@ files:
|
|
267
268
|
- doc/release_notes/1_3_1.md
|
268
269
|
- doc/release_notes/1_3_2.md
|
269
270
|
- doc/release_notes/1_3_3.md
|
271
|
+
- doc/release_notes/1_3_4.md
|
270
272
|
- lib/httpx.rb
|
271
273
|
- lib/httpx/adapters/datadog.rb
|
272
274
|
- lib/httpx/adapters/faraday.rb
|