fluent / fluent-logger-forward-node

A fluent forward protocol implementation for Node.js
https://fluent.github.io/fluent-logger-forward-node/
Apache License 2.0
11 stars 8 forks source link

Fix msgpack str protocol parsing #38

Closed jamiees2 closed 2 years ago

jamiees2 commented 2 years ago

This fixes an issue with the protocol as sent by FluentD. When data is sent in the msgpack str format, the data ends up getting deserialized as UTF8 in @msgpack/msgpack. When this happens, the data is mangled irreversibly, as @msgpack/msgpack expects UTF8 formatted data. This adds a lazy hack to instead just parse as a buffer when the buffer starts with either 0x92 - fixarr of size 2, or 0x1f, compressed buffer.

Fixes #37

Signed-off-by: James Elias Sigurdarson jamiees2@gmail.com