From b836292a732d2d9e38938a0068ce2266a60d6df8 Mon Sep 17 00:00:00 2001 From: vaclav-pur Date: Wed, 31 Aug 2016 09:10:49 +0200 Subject: [PATCH] Update XMLHttpRequest.js Some components/frameworks work with Content-type instead of Content-Type --- lib/XMLHttpRequest.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index 4893913..0a84c85 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -361,8 +361,8 @@ exports.XMLHttpRequest = function() { data = null; } else if (data) { headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data); - - if (!headers["Content-Type"]) { + // Some components/frameworks work with Content-type instead of Content-Type + if (!headers["Content-Type"] && !headers["Content-type"]) { headers["Content-Type"] = "text/plain;charset=UTF-8"; } } else if (settings.method === "POST") {