From f4e02be00db4b83416d78f9056e4ce54c8f68ed3 Mon Sep 17 00:00:00 2001 From: joHNkHaNsrc Date: Tue, 1 Mar 2022 11:19:45 +0100 Subject: [PATCH] fix: Iaphub first request --- src/Controller/IaphubWebhookEntrypointController.php | 5 +++++ 1 file changed, 5 insertions(+) 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);