Revert "Update src/Network/GuzzleResponse.php"
This reverts commit 79e667b3
This commit is contained in:
parent
7a8baf1eea
commit
ef06fab744
1 changed files with 6 additions and 1 deletions
|
@ -89,7 +89,12 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface
|
||||||
public function getContentType()
|
public function getContentType()
|
||||||
{
|
{
|
||||||
$contentTypes = $this->getHeader('Content-Type') ?? [];
|
$contentTypes = $this->getHeader('Content-Type') ?? [];
|
||||||
return array_pop($contentTypes) ?? '';
|
$countTypes = count($contentTypes);
|
||||||
|
if ($countTypes > 0) {
|
||||||
|
return $contentTypes[$countTypes - 1];
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
Loading…
Reference in a new issue