Skip to content

Ungzipping gzipped response from prerender service produces corrupted unicode strings #192

Open

Description

@ilyazolotarov

This is where bad things happens - if chunk contains only part of unicode character then implicit Buffer.toString() produces corrupted string.

The fix will be to keep an array of chunks and then invoking Buffer.concat(chunks).toString() at the end.

Simple repro with hotfix

Activity

  1. ilyazolotarov commented on Dec 9, 2019

    @ilyazolotarov
    Author

    Just noticed that prerender.plainResponse can also have this bug. Not sure if chunk is Buffer or String in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions