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

Calculate buffer length of utf-8 data for json correctly #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

myndzi
Copy link

@myndzi myndzi commented Dec 30, 2016

Since we're explicitly calculating the utf-8 length (as far as I can tell, this is an implicit assumption overall) when encoding JSON, I made sure to add it to the Content-Type header too.

The denormalization of the content-length header is so we don't have to do the extra work of calculating the utf8-length if we don't have to.

There is no real test structure to speak of, so I just tested the failing case before and after to ensure it succeeds.

Closes #28

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