$request->path() 有问题
- Dominant language
- PHP
- Stars
- 11.6k
- Forks
- 2.2k
- Avg merge
- 11h 30m
- Merged PRs (30d)
- 3
Description
$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": ""
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the example using Workerman\Protocols\Http\Request and compare the values returned by uri() and path(). Start by tracing the HTTP request parsing entry point for the Request class; done means path() returns /hpt/v1/CurrentTime for this POST request instead of an empty string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100