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

Fixed wrong content length when request body contains non-ascii characters #2

Merged

Conversation

yesyo
Copy link
Contributor

@yesyo yesyo commented Jul 1, 2014

Content-Length is bytes and not necessarily string length. Using Buffer.byteLength(string) will always be correct. Ref stackoveflow question http://stackoverflow.com/questions/18692580/node-js-post-causes-error-socket-hang-up-code-econnreset

@jhnns
Copy link
Member

jhnns commented Jul 1, 2014

Excellent! 👍 Haven't thought of that...

I'll merge it as soon as I'm home, but it might be obsolete anyway as I'm trying to replace the http server with a stdin/stdout-solution.

@yesyo
Copy link
Contributor Author

yesyo commented Jul 1, 2014

No problem at all, thanks for the great work.

jhnns added a commit that referenced this pull request Jul 2, 2014
…ii-request

Fixed wrong content length when request body contains non-ascii characters
@jhnns jhnns merged commit 9efb0e8 into peerigon:master Jul 2, 2014
@jhnns
Copy link
Member

jhnns commented Jul 2, 2014

Shipped with v0.1.4

@yesyo yesyo deleted the bug/wrong-content-length-for-non-ascii-request branch July 3, 2014 01:45
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