Skip to content

Conversation

@EthianWong
Copy link
Contributor

In other languages (Chinese , Japanese .... )
One word maybe use two or three bytes ...

var a = "我爱你";
console.log(a.length); //3
console.log(new Buffer(a).length); //9

So you should use new Buffer for set "Content-Length" and this problem will be resolve

@niemyjski
Copy link
Member

I'm trying to figure out what the core fix is here as It's broken on desktop as well (outside of Buffer)

@niemyjski niemyjski merged commit c9988f5 into exceptionless:master Nov 11, 2016
@niemyjski
Copy link
Member

Thank you for this change. I'm going to test it further and then deploy a release

@niemyjski
Copy link
Member

I changed this up to use Buffer.byteLength(request.data) instead as Buffer(string).length returns the allocated memory length instead of the actual byte count

@niemyjski
Copy link
Member

niemyjski added a commit that referenced this pull request Nov 11, 2016
@niemyjski
Copy link
Member

This has been deployed (https://github.com/exceptionless/Exceptionless.JavaScript/releases/tag/v1.4.2) Thank you for your contributions!

@EthianWong
Copy link
Contributor Author

You're welcome~ This is my first time to contributions in github~ make me exciting

@niemyjski
Copy link
Member

We greatly appreciate it and would love to have you apart of our community :). Please feel free to hang out and chat with other developers on our slack channel: slack.exceptionless.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants