mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
HTTP In - fix header iterator
This commit is contained in:
parent
c079576e49
commit
55679694c9
@ -169,10 +169,12 @@ 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) {
|
||||||
|
if (msg.headers.hasOwnProperty(v)) {
|
||||||
opts.headers[v.toLowerCase()] = msg.headers[v];
|
opts.headers[v.toLowerCase()] = msg.headers[v];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (this.credentials && this.credentials.user) {
|
if (this.credentials && this.credentials.user) {
|
||||||
opts.auth = this.credentials.user+":"+(this.credentials.password||"");
|
opts.auth = this.credentials.user+":"+(this.credentials.password||"");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user