HTTP In - fix header iterator

This commit is contained in:
Nick O'Leary 2014-07-23 21:28:53 +01:00
parent c079576e49
commit 55679694c9
1 changed files with 4 additions and 2 deletions

View File

@ -169,8 +169,10 @@ module.exports = function(RED) {
opts.method = method; opts.method = method;
opts.headers = {}; opts.headers = {};
if (msg.headers) { if (msg.headers) {
for (var v = 0; v < msg.headers.length; v++) { for (var v in msg.headers) {
opts.headers[v.toLowerCase()] = msg.headers[v]; if (msg.headers.hasOwnProperty(v)) {
opts.headers[v.toLowerCase()] = msg.headers[v];
}
} }
} }
if (this.credentials && this.credentials.user) { if (this.credentials && this.credentials.user) {