Skip to content

Fix response parsing for unzipped responses #31

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hpawe01
Copy link

@hpawe01 hpawe01 commented Nov 21, 2024

Commit 1611ba6 added support for unzipped responses but forgot to concatenate the buffers before converting them to a string. This results in a corrupt JSON string if we have more than one element in the response buffers (e.g. for a large response). If we have multiple elements in the response buffers responseBuffers.toString() would include ',' as default concatenation character. We could also use responseBuffers.join('') to get the same result, but with Buffer.concat(responseBuffers) we can use the same object also as parameter for the gunzip method in case the response is gzipped.

commit 1611ba6 added support for unzipped responses but forgot to concatenate the buffers before converting them to a string.
@hpawe01
Copy link
Author

hpawe01 commented Nov 22, 2024

Fixes #33

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 this pull request may close these issues.

1 participant