Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$request->path() 有问题 #1035

Open
yemaozi999 opened this issue May 24, 2024 · 1 comment
Open

$request->path() 有问题 #1035

yemaozi999 opened this issue May 24, 2024 · 1 comment

Comments

@yemaozi999
Copy link

$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": ""
}

@walkor
Copy link
Owner

walkor commented May 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants