Skip to content

Commit

Permalink
fix: Iaphub first request
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkhansrc committed Mar 1, 2022
1 parent c90fca6 commit f4e02be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Controller/IaphubWebhookEntrypointController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f4e02be

Please sign in to comment.