Skip to content

Commit 454fd6e

Browse files
committed
Add false to getContent call
1 parent e5d1ed2 commit 454fd6e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Authenticator/RequestAuthenticator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ public function authenticate(Request $request): bool
3737
return false;
3838
}
3939

40+
$content = $request->getContent(false);
41+
4042
$content = json_encode(
41-
json_decode($request->getContent(), true),
43+
json_decode($content, true),
4244
\JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE,
4345
);
4446

src/Controller/UserComAgreementsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __invoke(Request $request): Response
3636
if (false === $this->requestAuthenticator->authenticate($request)) {
3737
return new JsonResponse('Unauthorized', Response::HTTP_UNAUTHORIZED);
3838
}
39-
$payload = json_decode($request->getContent(), true);
39+
$payload = json_decode($request->getContent(false), true);
4040

4141
if (!is_array($payload) || [] === $payload) {
4242
return new JsonResponse('Invalid JSON payload', Response::HTTP_BAD_REQUEST);

0 commit comments

Comments
 (0)