Skip to content

Commit

Permalink
Merge pull request #2958 from Ayesh/strict-comparison
Browse files Browse the repository at this point in the history
Strict empty string content type checking in BodyParsingMiddleware::getMediaType
  • Loading branch information
l0gicgate committed May 6, 2020
2 parents 955dadf + 6f94beb commit b081ebd
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 b081ebd

Please sign in to comment.