do not perform string operations on null
This commit is contained in:
parent
e9f524a37e
commit
600bde9562
@ -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);
|
||||
|
Reference in New Issue
Block a user