Skip to content

Commit

Permalink
parse body if empty and has media type detected
Browse files Browse the repository at this point in the history
  • Loading branch information
esetnik committed Aug 7, 2019
1 parent 52693db commit 15617fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ public function getParsedBody()
{
$parsedBody = $this->serverRequest->getParsedBody();

if ($parsedBody !== null) {
if (!empty($parsedBody)) {
return $parsedBody;
}

$mediaType = $this->getMediaType();
if ($mediaType === null) {
return null;
return $parsedBody;
}

// Check if this specific media type has a parser registered first
Expand Down

0 comments on commit 15617fa

Please sign in to comment.