Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilyazolotarov opened this issue Dec 9, 2019 · 1 comment · May be fixed by #193
Open

Comments

@ilyazolotarov
Copy link

ilyazolotarov commented Dec 9, 2019

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

@ilyazolotarov
Copy link
Author

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

ilyazolotarov added a commit to ilyazolotarov/prerender-node that referenced this issue Dec 10, 2019
ilyazolotarov added a commit to ilyazolotarov/prerender-node that referenced this issue Dec 10, 2019
@ilyazolotarov ilyazolotarov linked a pull request Dec 10, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant