Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 176c37b

Browse files
authored
Merge pull request #13 from fracz/patch-1
Return immediately if request is not json
2 parents 54efc90 + a56ada7 commit 176c37b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Qandidate/Common/Symfony/HttpKernel/EventListener/JsonRequestTransformerListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public function onKernelRequest(GetResponseEvent $event)
2727
{
2828
$request = $event->getRequest();
2929

30-
$content = $request->getContent();
31-
32-
if (empty($content)) {
30+
if (! $this->isJsonRequest($request)) {
3331
return;
3432
}
33+
34+
$content = $request->getContent();
3535

36-
if (! $this->isJsonRequest($request)) {
36+
if (empty($content)) {
3737
return;
3838
}
3939

0 commit comments

Comments
 (0)