Add Expression-Support to responseHeaders

This commit is contained in:
Jan Oberhauser 2020-04-26 15:28:51 +02:00
parent a9e665dd9b
commit a3106219f4
2 changed files with 12 additions and 3 deletions

View file

@ -150,11 +150,16 @@ export function getWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflo
}
if (webhookData.webhookDescription['responseHeaders'] !== undefined) {
const responseHeaders = workflow.getComplexParameterValue(workflowStartNode, webhookData.webhookDescription['responseHeaders'], undefined) as any;
const responseHeaders = workflow.getComplexParameterValue(workflowStartNode, webhookData.webhookDescription['responseHeaders'], undefined) as {
entries?: Array<{
name: string;
value: string;
}> | undefined;
};
if (responseHeaders !== undefined && responseHeaders['entries'] !== undefined) {
for (const item of responseHeaders['entries']) {
res.setHeader(item['name'], item['value'])
res.setHeader(item['name'], item['value']);
}
}
}

View file

@ -759,7 +759,11 @@ export class Workflow {
}
};
return this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData);
// Resolve the "outer" main values
const returnData = this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData);
// Resolve the "inner" values
return this.getParameterValue(returnData, runData, runIndex, itemIndex, node.name, connectionInputData);
}
/**