diff --git a/src/Purl.php b/src/Purl.php index 41189f0..8e80b5c 100644 --- a/src/Purl.php +++ b/src/Purl.php @@ -207,13 +207,13 @@ public function execute() } if ($this->_headers) { - foreach ($this->_headers as $name => $value) { - $headers .= $name . ': ' . $value . "\r\n"; + foreach ($this->_headers as $value) { + $headers .= $value . "\r\n"; } } - - if (!isset($this->_headers['Content-type'])) $headers .= "Content-type: " . "application/x-www-form-urlencoded"."\r\n"; - + + if (!preg_match('/Content-type/', $headers)) $headers .= "Content-type: " . "application/x-www-form-urlencoded"."\r\n"; + return $this->_call($query, $this->_info['request_header'] = $headers); } @@ -319,4 +319,4 @@ private function _errorHandler() $this->_errorno = 100; } } -} \ No newline at end of file +}