mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Slightly cleaner fasly checks
This commit is contained in:
parent
3123a5ee51
commit
7916dc9c05
@ -108,11 +108,10 @@ module.exports = function(RED) {
|
||||
const keyValue = header.keyValue;
|
||||
const valueType = header.valueType;
|
||||
const valueValue = header.valueValue;
|
||||
|
||||
|
||||
const headerName = keyType === 'other' ? keyValue : keyType;
|
||||
let headerValue;
|
||||
let result;
|
||||
|
||||
|
||||
switch(valueType){
|
||||
case 'other':
|
||||
headerValue = valueValue;
|
||||
@ -120,11 +119,7 @@ module.exports = function(RED) {
|
||||
|
||||
case 'env':
|
||||
case 'global':
|
||||
result = RED.util.evaluateNodeProperty(valueValue,valueType,node);
|
||||
if(!result){
|
||||
continue;
|
||||
}
|
||||
headerValue = result
|
||||
headerValue = RED.util.evaluateNodeProperty(valueValue,valueType,node);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -132,7 +127,9 @@ module.exports = function(RED) {
|
||||
break;
|
||||
}
|
||||
|
||||
options.headers[headerName] = headerValue
|
||||
if(headerName && headerValue){
|
||||
options.headers[headerName] = headerValue
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user