From 756f57f1988ae84b2b4f16febe6c0b7ac8e871b6 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 20 Aug 2021 19:48:22 +0200 Subject: [PATCH] Revert "Use last entry for Content-Type --- src/Network/GuzzleResponse.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Network/GuzzleResponse.php b/src/Network/GuzzleResponse.php index 72d87ae9fe..18155d1d29 100644 --- a/src/Network/GuzzleResponse.php +++ b/src/Network/GuzzleResponse.php @@ -88,7 +88,13 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface /** {@inheritDoc} */ 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} */