mint_http 0.1.10 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mint_http/request.rb +2 -2
- data/lib/mint_http/request_logger.rb +6 -1
- data/lib/mint_http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96c48d259517f6bb8012cf6e00600db417b48ebdb570bab246e4727f24707b7
|
4
|
+
data.tar.gz: a2b117a6ab762c733625d647aff7de509cc8a13a0679754dad16ed856290207d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1757883fb698f942f30f5f352229eee819733cde43961b9e82a35631d8bbc11e8cd2b690be4159194368200df3d521eba3b5ea847dadc5ddae953b270852219c
|
7
|
+
data.tar.gz: dad7ef02f77b7e0a8341216d6cc95f62a409a076c24e0a3bd6840e071208be9e1ceee52376aa6388d3bd4530ce4520659838b5b5acef590425a4974c59b0c444
|
data/lib/mint_http/request.rb
CHANGED
@@ -165,7 +165,7 @@ module MintHttp
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def accept_json
|
168
|
-
accept('application/json')
|
168
|
+
accept('application/json; charset=utf-8')
|
169
169
|
end
|
170
170
|
|
171
171
|
def content_type(type)
|
@@ -185,7 +185,7 @@ module MintHttp
|
|
185
185
|
|
186
186
|
def as_json
|
187
187
|
@body_type = :json
|
188
|
-
content_type('application/json')
|
188
|
+
content_type('application/json; charset=utf-8')
|
189
189
|
end
|
190
190
|
|
191
191
|
def as_form
|
@@ -79,7 +79,7 @@ module MintHttp
|
|
79
79
|
tls = "#{@tls_config[:version]} Cipher: #{@tls_config[:cipher]}"
|
80
80
|
end
|
81
81
|
|
82
|
-
buffer = String.new
|
82
|
+
buffer = String.new(encoding: 'UTF-8')
|
83
83
|
buffer << <<~TXT
|
84
84
|
MintHttp Log (#{@request.request_url})
|
85
85
|
@@ Timeouts: #{@request.open_timeout}, #{@request.write_timeout}, #{@request.read_timeout}
|
@@ -108,6 +108,8 @@ module MintHttp
|
|
108
108
|
end
|
109
109
|
|
110
110
|
@logger.info(buffer.strip)
|
111
|
+
rescue Encoding::CompatibilityError => e
|
112
|
+
@logger.warn(e)
|
111
113
|
end
|
112
114
|
|
113
115
|
def log_connection_info(http)
|
@@ -178,6 +180,9 @@ module MintHttp
|
|
178
180
|
return '[COMPLEX]'
|
179
181
|
end
|
180
182
|
|
183
|
+
# Force encoding to UTF-8 to allow logging
|
184
|
+
body = body.dup.force_encoding('utf-8')
|
185
|
+
|
181
186
|
unless @filter
|
182
187
|
return body
|
183
188
|
end
|
data/lib/mint_http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mint_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Alhoshaiyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.2.33
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: A small fluent HTTP client.
|