Only normalise known headers in http node

This commit is contained in:
Nick O'Leary 2014-09-22 20:44:22 +01:00
parent 5f77531a39
commit 1f95071a37
1 changed files with 7 additions and 1 deletions

View File

@ -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];
}
}
}