Update src/Network/GuzzleResponse.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
e17befb7d6
commit
79e667b3d1
|
@ -89,12 +89,7 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface
|
||||||
public function getContentType()
|
public function getContentType()
|
||||||
{
|
{
|
||||||
$contentTypes = $this->getHeader('Content-Type') ?? [];
|
$contentTypes = $this->getHeader('Content-Type') ?? [];
|
||||||
$countTypes = count($contentTypes);
|
return array_pop($contentTypes) ?? '';
|
||||||
if ($countTypes > 0) {
|
|
||||||
return $contentTypes[$countTypes - 1];
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user