|
|
|
@ -180,14 +180,13 @@ class Request extends \yii\base\Request
|
|
|
|
|
{ |
|
|
|
|
if ($this->_headers === null) { |
|
|
|
|
$this->_headers = new HeaderCollection; |
|
|
|
|
$headers = []; |
|
|
|
|
if (function_exists('getallheaders')) { |
|
|
|
|
$headers = getallheaders(); |
|
|
|
|
} elseif (function_exists('http_get_request_headers')) { |
|
|
|
|
$headers = http_get_request_headers(); |
|
|
|
|
} else { |
|
|
|
|
foreach ($_SERVER as $name => $value) { |
|
|
|
|
if (substr($name, 0, 5) == 'HTTP_') { |
|
|
|
|
if (strncmp($name, 'HTTP_', 5) === 0) { |
|
|
|
|
$name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); |
|
|
|
|
$this->_headers->add($name, $value); |
|
|
|
|
} |
|
|
|
|