Browse Source

small refactoring + cleanup request

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
190417f917
  1. 3
      framework/web/Request.php

3
framework/web/Request.php

@ -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);
}

Loading…
Cancel
Save