From 25a445e88d8bd42d95494242d528ab80c45c7868 Mon Sep 17 00:00:00 2001 From: rvelasq <132245714+rvelasq@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:01:42 +0800 Subject: [PATCH] fix custom headers not being applied on webhook (#374) --- endpoints/cronjobs/sendnotifications.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/endpoints/cronjobs/sendnotifications.php b/endpoints/cronjobs/sendnotifications.php index 58abdcc84..44c21186b 100644 --- a/endpoints/cronjobs/sendnotifications.php +++ b/endpoints/cronjobs/sendnotifications.php @@ -477,8 +477,9 @@ curl_setopt($ch, CURLOPT_URL, $webhook['url']); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $webhook['request_method']); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload_json)); - if (!empty($customheaders)) { - curl_setopt($ch, CURLOPT_HTTPHEADER, $webhook['headers']); + if (!empty($webhook['headers'])) { + $customheaders = preg_split("/\r\n|\n|\r/", $webhook['headers']); + curl_setopt($ch, CURLOPT_HTTPHEADER, $customheaders); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);