Webhook: allow setting generic response-headers

This commit is contained in:
Davide Cavestro
2020-04-26 11:01:20 +02:00
parent 538ad3b98d
commit db2329b26c
3 changed files with 70 additions and 0 deletions

View File

@@ -149,6 +149,16 @@ export function getWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflo
};
}
if (webhookData.webhookDescription['responseHeaders'] !== undefined) {
const responseHeaders = workflow.getComplexParameterValue(workflowStartNode, webhookData.webhookDescription['responseHeaders'], undefined) as any;
if (responseHeaders !== undefined && responseHeaders['entries'] !== undefined) {
for (const item of responseHeaders['entries']) {
res.setHeader(item['name'], item['value'])
}
}
}
if (webhookResultData.noWebhookResponse === true && didSendResponse === false) {
// The response got already send
responseCallback(null, {