From 15617fa80bf47c29d4387673f9c54bacd07c2294 Mon Sep 17 00:00:00 2001 From: Ethan Setnik Date: Wed, 7 Aug 2019 13:43:59 -0400 Subject: [PATCH] parse body if empty and has media type detected --- src/ServerRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ServerRequest.php b/src/ServerRequest.php index 3105355..fd6e07f 100644 --- a/src/ServerRequest.php +++ b/src/ServerRequest.php @@ -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