Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){

Expand Down
13 changes: 9 additions & 4 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down