mint_http 0.1.10 → 0.1.12

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: 77ff75e95387e2ccfde90a946d31a9b7550d45d337ebbedc8838003018296b70
4
- data.tar.gz: 51f733220f11dae0439d0f30ecf80eab46925c5e5cfa019b42a62057c5bc7c3b
3
+ metadata.gz: d96c48d259517f6bb8012cf6e00600db417b48ebdb570bab246e4727f24707b7
4
+ data.tar.gz: a2b117a6ab762c733625d647aff7de509cc8a13a0679754dad16ed856290207d
5
5
  SHA512:
6
- metadata.gz: 9790d2693d711a634d26f19243fcdca950845118c831174f6426183d77fd885807f6391e17fcf25c8106894acccbb3b0da1a007b74ce7eefab33de06437387b4
7
- data.tar.gz: cdc34a5e635f37e98f8e2981b634675152eab7218ab82e6bae669a2fb1842479f1c8b3c1af0831435161b9128af241c640e925197c53a7e322682425ec84e576
6
+ metadata.gz: 1757883fb698f942f30f5f352229eee819733cde43961b9e82a35631d8bbc11e8cd2b690be4159194368200df3d521eba3b5ea847dadc5ddae953b270852219c
7
+ data.tar.gz: dad7ef02f77b7e0a8341216d6cc95f62a409a076c24e0a3bd6840e071208be9e1ceee52376aa6388d3bd4530ce4520659838b5b5acef590425a4974c59b0c444
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MintHttp
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.12"
5
5
  end
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.10
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-07-20 00:00:00.000000000 Z
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.4.10
135
+ rubygems_version: 3.2.33
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: A small fluent HTTP client.