改名
This commit is contained in:
@@ -117,13 +117,12 @@ class HTTPServerListener extends Abstracts\Server
|
|||||||
public function onRequest(Request $request, Response $response)
|
public function onRequest(Request $request, Response $response)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var_dump($request);
|
|
||||||
$node = $this->router->Branch_search(HSRequest::create($request));
|
$node = $this->router->Branch_search(HSRequest::create($request));
|
||||||
if (!($node instanceof Node)) {
|
if (!($node instanceof Node)) {
|
||||||
throw new RequestException('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>', 404);
|
throw new RequestException('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>', 404);
|
||||||
}
|
}
|
||||||
if (!(($responseData = $node->dispatch()) instanceof ResponseInterface)) {
|
if (!(($responseData = $node->dispatch()) instanceof ResponseInterface)) {
|
||||||
$responseData = $this->response->setContent($node->dispatch())->setStatusCode(200);
|
$responseData = $this->response->setContent($responseData)->setStatusCode(200);
|
||||||
}
|
}
|
||||||
} catch (Error | Throwable $exception) {
|
} catch (Error | Throwable $exception) {
|
||||||
$responseData = $this->exceptionHandler->emit($exception, $this->response);
|
$responseData = $this->exceptionHandler->emit($exception, $this->response);
|
||||||
|
|||||||
Reference in New Issue
Block a user