1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

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