Revert "Use last entry for Content-Type

This commit is contained in:
Philipp 2021-08-20 19:48:22 +02:00
parent 50e2478189
commit 756f57f198
No known key found for this signature in database
GPG Key ID: 9A28B7D4FF5667BD

View File

@ -88,7 +88,13 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface
/** {@inheritDoc} */ /** {@inheritDoc} */
public function getContentType() public function getContentType()
{ {
return implode($this->getHeader('Content-Type')); $contentTypes = $this->getHeader('Content-Type') ?? [];
$countTypes = count($contentTypes);
if ($countTypes > 0) {
return $contentTypes[$countTypes - 1];
} else {
return '';
}
} }
/** {@inheritDoc} */ /** {@inheritDoc} */