walkor / walkor/workerman

$request->path() 有问题

Open
#1,035 1 comment 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.