Skip to content

Commit 4e1c61b

Browse files
authored
"Content-Type" gets overridden
If the user gas set "content-type" (lowercase) then it will get overridden.
1 parent 86ff70e commit 4e1c61b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/XMLHttpRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ exports.XMLHttpRequest = function() {
362362
} else if (data) {
363363
headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data);
364364

365-
if (!headers["Content-Type"]) {
365+
if (!this.getRequestHeader("Content-Type")) {
366366
headers["Content-Type"] = "text/plain;charset=UTF-8";
367367
}
368368
} else if (settings.method === "POST") {

0 commit comments

Comments
 (0)