mint_http 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77ff75e95387e2ccfde90a946d31a9b7550d45d337ebbedc8838003018296b70
4
- data.tar.gz: 51f733220f11dae0439d0f30ecf80eab46925c5e5cfa019b42a62057c5bc7c3b
3
+ metadata.gz: 13d0c6552e8bbf4b2d407cfb63f912116332c050ef55ff2b40249e357eaf50b2
4
+ data.tar.gz: bb5ed66026c77894f50c1cb4f399e5cb6c4636213105ee2d6cd041c3718ab36c
5
5
  SHA512:
6
- metadata.gz: 9790d2693d711a634d26f19243fcdca950845118c831174f6426183d77fd885807f6391e17fcf25c8106894acccbb3b0da1a007b74ce7eefab33de06437387b4
7
- data.tar.gz: cdc34a5e635f37e98f8e2981b634675152eab7218ab82e6bae669a2fb1842479f1c8b3c1af0831435161b9128af241c640e925197c53a7e322682425ec84e576
6
+ metadata.gz: c77b61d61e1268f799c2bfaf57d14fbea69255156c6b4b05c77df50df19bf188e4145134158a20876bbdea37a337a649fbd1253a3ff9c502a47e63b52219e63f
7
+ data.tar.gz: 101e27c0c4fcf208ce2eb80dbba3a5fa4d998937cf57db20d61ed76a94c4e8c0fc8ab42096c8f6d535bc1bba7b95990a895a8b5c308958dab4767b9333d3f1b9
@@ -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.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.11"
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.11
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.