Skip to content

Commit 9af481d

Browse files
Discard null, true, and false responses too
1 parent 53f9589 commit 9af481d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/HttpClient/Message/ResponseMediator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function getContent(ResponseInterface $response)
4545
{
4646
$body = (string) $response->getBody();
4747

48-
if ('' !== $body && 0 === \strpos($response->getHeaderLine('Content-Type'), self::JSON_CONTENT_TYPE)) {
48+
if (in_array($body, ['', 'null', 'true', 'false'], true) && 0 === \strpos($response->getHeaderLine('Content-Type'), self::JSON_CONTENT_TYPE)) {
4949
return JsonArray::decode($body);
5050
}
5151

0 commit comments

Comments
 (0)