Skip to content

Commit

Permalink
Merge pull request #100 from esetnik/bugfix/parsed-body
Browse files Browse the repository at this point in the history
parse body if empty and has media type detected
  • Loading branch information
l0gicgate committed Aug 29, 2019
2 parents 52693db + 15617fa commit a614882
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ServerRequest.php
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 a614882

Please sign in to comment.