111
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Http\Handler\Abstracts;
|
namespace Http\Handler\Abstracts;
|
||||||
|
|
||||||
|
use Annotation\Inject;
|
||||||
use Http\Handler\Handler as CHl;
|
use Http\Handler\Handler as CHl;
|
||||||
use Http\Message\ServerRequest;
|
use Http\Message\ServerRequest;
|
||||||
use Kiri\Core\Help;
|
use Kiri\Core\Help;
|
||||||
@@ -22,6 +23,9 @@ abstract class Handler implements RequestHandlerInterface
|
|||||||
|
|
||||||
protected CHl $handler;
|
protected CHl $handler;
|
||||||
|
|
||||||
|
#[Inject(AspectProxy::class)]
|
||||||
|
protected AspectProxy $aspectProxy;
|
||||||
|
|
||||||
protected ?array $middlewares;
|
protected ?array $middlewares;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,8 +79,8 @@ abstract class Handler implements RequestHandlerInterface
|
|||||||
*/
|
*/
|
||||||
protected function dispatcher(ServerRequestInterface $request): mixed
|
protected function dispatcher(ServerRequestInterface $request): mixed
|
||||||
{
|
{
|
||||||
$aspect = Kiri::getDi()->get(AspectProxy::class);
|
$response = $this->aspectProxy->proxy($this->handler);
|
||||||
if (!(($response = $aspect->proxy($this->handler)) instanceof ResponseInterface)) {
|
if (!($response instanceof ResponseInterface)) {
|
||||||
$response = $this->transferToResponse($response);
|
$response = $this->transferToResponse($response);
|
||||||
}
|
}
|
||||||
$response->withHeader('Run-Time', $this->_runTime($request));
|
$response->withHeader('Run-Time', $this->_runTime($request));
|
||||||
|
|||||||
Reference in New Issue
Block a user