do not perform string operations on null

This commit is contained in:
Christian Flothmann 2019-09-09 12:09:16 +02:00
parent e9f524a37e
commit 600bde9562

View File

@ -506,7 +506,9 @@ trait HttpClientTrait
private static function shouldBuffer(array $headers): bool
{
$contentType = $headers['content-type'][0] ?? null;
if (null === $contentType = $headers['content-type'][0] ?? null) {
return false;
}
if (false !== $i = strpos($contentType, ';')) {
$contentType = substr($contentType, 0, $i);