Browse Source

fix(webhooks): Refuse webhooks registration if auth header is used without auth data

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/45475/head
Côme Chilliet 1 year ago
committed by Côme Chilliet
parent
commit
74e5812c26
  1. 3
      apps/webhooks/lib/Db/WebhookListener.php

3
apps/webhooks/lib/Db/WebhookListener.php

@ -78,6 +78,9 @@ class WebhookListener extends Entity implements \JsonSerializable {
public function setAuthDataClear(?array $data): void {
if ($data === null) {
if ($this->getAuthMethodEnum() === AuthMethod::Header) {
throw new \UnexpectedValueException('Header auth method needs an associative array of headers as auth data');
}
$this->setAuthData(null);
return;
}

Loading…
Cancel
Save