From 1f95071a37b8121906cdd128116530eb3c8e9b7e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 22 Sep 2014 20:44:22 +0100 Subject: [PATCH] Only normalise known headers in http node --- nodes/core/io/21-httpin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nodes/core/io/21-httpin.js b/nodes/core/io/21-httpin.js index abc2431a7..877ccc09e 100644 --- a/nodes/core/io/21-httpin.js +++ b/nodes/core/io/21-httpin.js @@ -171,7 +171,13 @@ module.exports = function(RED) { if (msg.headers) { for (var v in msg.headers) { if (msg.headers.hasOwnProperty(v)) { - opts.headers[v.toLowerCase()] = msg.headers[v]; + var name = v.toLowerCase(); + if (name !== "content-type" && name !== "content-length") { + // only normalise the known headers used later in this + // function. Otherwise leave them alone. + name = v; + } + opts.headers[name] = msg.headers[v]; } } }