]> git.mxchange.org Git - friendica.git/commitdiff
Revert "Use last entry for Content-Type
authorPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:48:22 +0000 (19:48 +0200)
committerPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:58:42 +0000 (19:58 +0200)
src/Network/GuzzleResponse.php

index 72d87ae9fe94d1ec8145391fd0322efe999d0639..18155d1d292901cf2ac2fea194086cdccd3d8fa6 100644 (file)
@@ -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} */