aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-06-10 16:26:59 +0200
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-06-11 14:10:29 +0200
commit621c068680bb4710d45c86764c718bb8edb46506 (patch)
treec1c0fa4de4b50ca1984b28966d2aa1e0c9b2a7ee /apps
parentbb2cb45340225e0e72540ecaf42a31c58376f5aa (diff)
downloadnextcloud-server-621c068680bb4710d45c86764c718bb8edb46506.tar.gz
nextcloud-server-621c068680bb4710d45c86764c718bb8edb46506.zip
fix(webhooks): fix crash when headers is null with header auth method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/webhooks/lib/BackgroundJobs/WebhookCall.php2
-rw-r--r--apps/webhooks/lib/Db/WebhookListener.php1
2 files changed, 2 insertions, 1 deletions
diff --git a/apps/webhooks/lib/BackgroundJobs/WebhookCall.php b/apps/webhooks/lib/BackgroundJobs/WebhookCall.php
index 06c3a4cf5d7..1d5eeafdc75 100644
--- a/apps/webhooks/lib/BackgroundJobs/WebhookCall.php
+++ b/apps/webhooks/lib/BackgroundJobs/WebhookCall.php
@@ -32,7 +32,7 @@ class WebhookCall extends QueuedJob {
$client = $this->clientService->newClient();
$options = [];
$options['body'] = json_encode($data);
- $options['headers'] = $webhookListener->getHeaders();
+ $options['headers'] = $webhookListener->getHeaders() ?? [];
try {
switch ($webhookListener->getAuthMethodEnum()) {
case AuthMethod::None:
diff --git a/apps/webhooks/lib/Db/WebhookListener.php b/apps/webhooks/lib/Db/WebhookListener.php
index fafda909f60..a949d93c9ea 100644
--- a/apps/webhooks/lib/Db/WebhookListener.php
+++ b/apps/webhooks/lib/Db/WebhookListener.php
@@ -15,6 +15,7 @@ use OCP\Security\ICrypto;
/**
* @method void setUserId(string $userId)
* @method string getUserId()
+ * @method ?array getHeaders()
*/
class WebhookListener extends Entity implements \JsonSerializable {
/** @var ?string id of the app_api application who added the webhook listener */