File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
88## [ Unreleased]
99
10- ## [ 1.0 .0] - 2021-02-11
10+ ## [ 0.1 .0] - 2021-02-11
1111
1212- The first version of the client.
13+
14+ ## [ 0.1.2] - 2021-04-22
15+
16+ - Fixed string encoding.
Original file line number Diff line number Diff line change @@ -201,10 +201,20 @@ def build_request(msgs)
201201 req [ 'Authorization' ] = authorization_payload
202202 req [ 'Content-Type' ] = CONTENT_TYPE
203203 req [ 'User-Agent' ] = USER_AGENT
204- req . body = msgs . to_msgpack
204+ req . body = msgs . map { | msg | force_utf8_encoding ( msg . to_hash ) } . to_msgpack
205205 req
206206 end
207207
208+ def force_utf8_encoding ( data )
209+ if data . respond_to? ( :force_encoding )
210+ data . dup . force_encoding ( 'UTF-8' )
211+ elsif data . respond_to? ( :transform_values )
212+ data . transform_values { |val | force_utf8_encoding ( val ) }
213+ else
214+ data
215+ end
216+ end
217+
208218 # Flushes the message buffer asynchronously. The reason we provide this
209219 # method is because the message buffer limit is constricted by the
210220 # Logtail API. The application limit is multiples of the buffer limit,
Original file line number Diff line number Diff line change 11module Logtail
2- VERSION = "0.1.1 "
2+ VERSION = "0.1.2 "
33end
You can’t perform that action at this time.
0 commit comments