File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/Symfony/Component/Webhook/Client Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 18
18
use Symfony \Component \HttpFoundation \RequestMatcher \MethodRequestMatcher ;
19
19
use Symfony \Component \HttpFoundation \RequestMatcherInterface ;
20
20
use Symfony \Component \RemoteEvent \RemoteEvent ;
21
+ use Symfony \Component \Webhook \Exception \InvalidArgumentException ;
21
22
use Symfony \Component \Webhook \Exception \RejectWebhookException ;
22
23
23
24
/**
@@ -43,6 +44,10 @@ protected function getRequestMatcher(): RequestMatcherInterface
43
44
44
45
protected function doParse (Request $ request , #[\SensitiveParameter] string $ secret ): RemoteEvent
45
46
{
47
+ if (!$ secret ) {
48
+ throw new InvalidArgumentException ('A non-empty secret is required. ' );
49
+ }
50
+
46
51
$ body = $ request ->toArray ();
47
52
48
53
foreach ([$ this ->signatureHeaderName , $ this ->eventHeaderName , $ this ->idHeaderName ] as $ header ) {
You can’t perform that action at this time.
0 commit comments