Skip to content

Commit

Permalink
Strict empty string content type checking in BodyParsingMiddleware::g…
Browse files Browse the repository at this point in the history
…etMediaType
  • Loading branch information
Ayesh committed May 6, 2020
1 parent 955dadf commit 6f94beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Slim/Middleware/BodyParsingMiddleware.php
Expand Up @@ -181,7 +181,7 @@ protected function getMediaType(ServerRequestInterface $request): ?string
{
$contentType = $request->getHeader('Content-Type')[0] ?? null;

if (is_string($contentType) && trim($contentType) != '') {
if (is_string($contentType) && trim($contentType) !== '') {
$contentTypeParts = explode(';', $contentType);
return strtolower(trim($contentTypeParts[0]));
}
Expand Down

0 comments on commit 6f94beb

Please sign in to comment.