fix custom headers not being applied on webhook (#374)

This commit is contained in:
rvelasq 2024-06-05 14:01:42 +08:00 committed by GitHub
parent 4342787ace
commit 25a445e88d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);