1、内核更新
2、代码更新
This commit is contained in:
@@ -124,10 +124,10 @@ class Request
|
||||
|
||||
/**
|
||||
* 架构函数
|
||||
* @access public
|
||||
* @access protected
|
||||
* @param array $options 参数
|
||||
*/
|
||||
public function __construct($options = [])
|
||||
protected function __construct($options = [])
|
||||
{
|
||||
foreach ($options as $name => $item) {
|
||||
if (property_exists($this, $name)) {
|
||||
@@ -910,18 +910,22 @@ class Request
|
||||
{
|
||||
if (empty($this->header)) {
|
||||
$header = [];
|
||||
$server = $this->server ?: $_SERVER;
|
||||
foreach ($server as $key => $val) {
|
||||
if (0 === strpos($key, 'HTTP_')) {
|
||||
$key = str_replace('_', '-', strtolower(substr($key, 5)));
|
||||
$header[$key] = $val;
|
||||
if (function_exists('apache_request_headers') && $result = apache_request_headers()) {
|
||||
$header = $result;
|
||||
} else {
|
||||
$server = $this->server ?: $_SERVER;
|
||||
foreach ($server as $key => $val) {
|
||||
if (0 === strpos($key, 'HTTP_')) {
|
||||
$key = str_replace('_', '-', strtolower(substr($key, 5)));
|
||||
$header[$key] = $val;
|
||||
}
|
||||
}
|
||||
if (isset($server['CONTENT_TYPE'])) {
|
||||
$header['content-type'] = $server['CONTENT_TYPE'];
|
||||
}
|
||||
if (isset($server['CONTENT_LENGTH'])) {
|
||||
$header['content-length'] = $server['CONTENT_LENGTH'];
|
||||
}
|
||||
}
|
||||
if (isset($server['CONTENT_TYPE'])) {
|
||||
$header['content-type'] = $server['CONTENT_TYPE'];
|
||||
}
|
||||
if (isset($server['CONTENT_LENGTH'])) {
|
||||
$header['content-length'] = $server['CONTENT_LENGTH'];
|
||||
}
|
||||
$this->header = array_change_key_case($header);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user