fix: [workflowModules:webhook] Gracefully handle case with empty headers

feature/workflow-module/publish-event
Sami Mokaddem 2023-10-10 08:58:14 +02:00
parent 79905a0eb8
commit c1be0c8ae7
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ class Module_webhook extends WorkflowBaseActionModule
$headers = [];
foreach ($tmpHeaders as $entry) {
$entry = explode(':', $entry, 2);
$headers[trim($entry[0])] = trim($entry[1]);
if (count($entry) == 2) {
$headers[trim($entry[0])] = trim($entry[1]);
}
}
try {
$response = $this->doRequest($params['url']['value'], $params['content_type']['value'], $payload, $headers, $params['request_method']['value']);