Skip to content

Commit

Permalink
*增加http_referer支持
Browse files Browse the repository at this point in the history
*引入think\Db
*增加对?s=对支持
  • Loading branch information
simplewindorg authored and liu21st committed Jan 23, 2019
1 parent 460cd4a commit c0e227c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Swoole\Http\Request;
use Swoole\Http\Response;
use think\App;
use think\Db;
use think\Error;
use think\exception\HttpException;
use think\facade\Config;
Expand Down Expand Up @@ -62,6 +63,14 @@ public function swoole(Request $request, Response $response)
$server['HTTP_X_REQUESTED_WITH'] = $header['x-requested-with'];
}

if (isset($header['referer'])) {
$server['http_referer'] = $header['referer'];
}

if (isset($_GET[$this->config->get('var_pathinfo')])) {
$server['path_info'] = $_GET[$this->config->get('var_pathinfo')];
}

$_SERVER = array_change_key_case($server, CASE_UPPER);

// 重新实例化请求对象 处理swoole请求数据
Expand Down

0 comments on commit c0e227c

Please sign in to comment.