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

Commit

Permalink
Return immediately if request is not json
Browse files Browse the repository at this point in the history
Fetching the contents before this check may result in OutOfMemory excpetion if the request is multipart with files.
  • Loading branch information
fracz authored Apr 24, 2017
1 parent 8d2d108 commit a56ada7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();

$content = $request->getContent();

if (empty($content)) {
if (! $this->isJsonRequest($request)) {
return;
}

$content = $request->getContent();

if (! $this->isJsonRequest($request)) {
if (empty($content)) {
return;
}

Expand Down

0 comments on commit a56ada7

Please sign in to comment.