diff --git a/src/Controller/IaphubWebhookEntrypointController.php b/src/Controller/IaphubWebhookEntrypointController.php index 9678c6f..a5a637c 100755 --- a/src/Controller/IaphubWebhookEntrypointController.php +++ b/src/Controller/IaphubWebhookEntrypointController.php @@ -56,6 +56,11 @@ public function index(Request $request): JsonResponse return $this->json([], Response::HTTP_UNAUTHORIZED); } + if (!$request->getContent()) { + // When add webhook url on Iaphub configuration, Iaphub should verify URL. + return $this->json([]); + } + $payload = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR); $webhook = $this->webhookFactory::build($payload);