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.
1 parent f14eb3e commit 4ba4386Copy full SHA for 4ba4386
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