diff --git a/src/Symfony/Component/Webhook/Client/RequestParser.php b/src/Symfony/Component/Webhook/Client/RequestParser.php index dc81765abf3a3..3b4b2a922cf86 100644 --- a/src/Symfony/Component/Webhook/Client/RequestParser.php +++ b/src/Symfony/Component/Webhook/Client/RequestParser.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\RequestMatcher\MethodRequestMatcher; use Symfony\Component\HttpFoundation\RequestMatcherInterface; use Symfony\Component\RemoteEvent\RemoteEvent; +use Symfony\Component\Webhook\Exception\InvalidArgumentException; use Symfony\Component\Webhook\Exception\RejectWebhookException; /** @@ -43,6 +44,10 @@ protected function getRequestMatcher(): RequestMatcherInterface protected function doParse(Request $request, #[\SensitiveParameter] string $secret): RemoteEvent { + if (!$secret) { + throw new InvalidArgumentException('A non-empty secret is required.'); + } + $body = $request->toArray(); foreach ([$this->signatureHeaderName, $this->eventHeaderName, $this->idHeaderName] as $header) {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: