From 01ead4bbd59a731543df93f34c7015a130efaeb7 Mon Sep 17 00:00:00 2001 From: "ARASHI, Jumpei" Date: Tue, 17 May 2016 18:06:34 +0900 Subject: [PATCH] Use buffer byte length at POST body --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index c89fbc8..e30c3b4 100644 --- a/lib/client.js +++ b/lib/client.js @@ -80,7 +80,7 @@ client.prototype.request = function(method, path, params, callback){ if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){ http_options["headers"] = { "Content-Type": params["contentType"] ? params["contentType"] : "application/json", - "Content-Length": body.length, + "Content-Length": Buffer.byteLength(body), }; }