diff --git a/src/Proxy.php b/src/Proxy.php index 152b256..e950493 100644 --- a/src/Proxy.php +++ b/src/Proxy.php @@ -46,7 +46,7 @@ private function header_callback($ch, $headers){ $value = trim($parts[1]); // this must be a header: value line - $this->response->headers->set($name, $value, false); + $this->response->headers->set($name, $value, true); } else if($this->status_found){ diff --git a/src/helpers.php b/src/helpers.php index 83e66d9..cdbc4b9 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,12 +2,17 @@ use Proxy\Config; -// strip away extra parameters text/html; charset=UTF-8 -function clean_content_type($content_type){ - return trim(preg_replace('@;.*@', '', $content_type)); +/** + * Strip away extra parameters "text/html; charset=UTF-8" + * @param $content_type + * @return string + */ +function clean_content_type($content_type) +{ + $content_type = (is_array($content_type) && count($content_type) > 0) ? $content_type[0] : $content_type; + return trim(preg_replace('@;.*@', '', $content_type)); } - if(!function_exists('starts_with')){ function starts_with($haystack, $needles){