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

Refactor contentLength to use byteLength #197

Closed
wants to merge 1 commit into from

Conversation

albertdbio
Copy link

@albertdbio albertdbio commented Jul 15, 2023

The contentLength was previously calculated from the string length property.

This does not account for multi-byte characters.

Thus we will get the following error when using unicode characters such as, ¿:

 Request body length does not match content-length header

The contentLength was previously calculated from the string length property. This does not account for multi-byte characters.
@rattrayalex
Copy link
Collaborator

Yes, sorry about this – we have an unreleased fix that should go out in the next beta!

@rattrayalex
Copy link
Collaborator

rattrayalex commented Jul 16, 2023

Closing this PR as we can't rely on Buffer being present in all contexts; I expect we'll have a release out tomorrow.

Thank you for taking the time to put together this contribution!

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.

None yet

2 participants