Fix IHTTPResult::getHeader/s()
[friendica.git/.git] / src / Network / CurlResult.php
index 1187e45..b0e8010 100644 (file)
@@ -242,23 +242,29 @@ class CurlResult implements IHTTPResult
        }
 
        /** {@inheritDoc} */
-       public function getHeader(string $field = '')
+       public function getHeader($header)
        {
-               if (empty($field)) {
-                       return $this->header;
+               if (empty($header)) {
+                       return '';
                }
 
-               $field = strtolower(trim($field));
+               $header = strtolower(trim($header));
 
                $headers = $this->getHeaderArray();
 
-               if (isset($headers[$field])) {
-                       return $headers[$field];
+               if (isset($headers[$header])) {
+                       return $headers[$header];
                }
 
                return '';
        }
 
+       /** {@inheritDoc} */
+       public function getHeaders()
+       {
+               return $this->getHeaderArray();
+       }
+
        /** {@inheritDoc} */
        public function inHeader(string $field)
        {