We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3c8328f + 4ba4386 commit c2ba3dfCopy full SHA for c2ba3df
lib/XMLHttpRequest.js
@@ -344,7 +344,7 @@ exports.XMLHttpRequest = function() {
344
if (settings.method === "GET" || settings.method === "HEAD") {
345
data = null;
346
} else if (data) {
347
- headers["Content-Length"] = Buffer.byteLength(data);
+ headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data);
348
349
if (!headers["Content-Type"]) {
350
headers["Content-Type"] = "text/plain;charset=UTF-8";
0 commit comments