fixed content length for utf8 bodies in the http connector

This commit is contained in:
Spencer Alger
2013-12-03 11:27:42 -07:00
parent 59c2965717
commit 2ddde47972

View File

@ -141,7 +141,7 @@ HttpConnector.prototype.request = function (params, cb) {
request.chunkedEncoding = false;
if (params.body) {
request.setHeader('Content-Length', params.body.length);
request.setHeader('Content-Length', Buffer.byteLength(params.body, 'utf8'));
request.end(params.body);
} else {
request.end();