walkor / workerman

An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.

Home Page:http://www.workerman.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$request->path() 有问题

yemaozi999 opened this issue · comments

$http_worker = new Worker('http://0.0.0.0:2883');
$http_worker->onMessage = function (\Workerman\Connection\TcpConnection $connection, \Workerman\Protocols\Http\Request $request)  {

    $get = $request->get();
    $post = $request->post();
    $header = $request->header();
    $data = [
        'header' => $header,
        'get' => $get,
        'post' => $post,
        'method'=> $request->method(),
        'uri'=>$request->uri(),
        'path'=>$request->path()
    ];
} 

}

$request->uri(); 有值
$request->path(); 为空 有问题 应该是 /hpt/v1/CurrentTime

结果:

{
"get": [],
"post": {
"ICCID": "",
"ICCID2": ""
},
"method": "POST",
"uri": "/:80/hpt/v1/CurrentTime",
"path": ""
}

uri 有值不代表 path就一定有值。
/:80/hpt/v1/CurrentTime 这种不是合法的path地址