Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function handle($request, Closure $next) |
||
19 | { |
||
20 | $signature = $request->header('Webhook-Signature'); |
||
21 | |||
22 | if (!$signature) { |
||
23 | throw WebhookFailed::missingSignature(); |
||
24 | } |
||
25 | |||
26 | if (!$this->isValid($signature, $request->getContent(), $request->route('configKey'))) { |
||
27 | throw WebhookFailed::invalidSignature($signature); |
||
28 | } |
||
29 | |||
30 | return $next($request); |
||
31 | } |
||
51 | } |