restify/clients

StringClient gunzip not safe for multibyte characters

lrowe opened this issue · 0 comments

lrowe commented

StringClient directly decodes chunks to utf8 strings which is not safe in the case of a chunk boundary falling within a multibyte character. Instead it should be using the string_decoder api which accounts for this. https://nodejs.org/api/string_decoder.html

body += chunk.toString('utf8');