diff --git a/http-handler/Abstracts/Middleware.php b/http-handler/Abstracts/Middleware.php index 0ef5e1d5..5e681292 100644 --- a/http-handler/Abstracts/Middleware.php +++ b/http-handler/Abstracts/Middleware.php @@ -13,8 +13,4 @@ use Server\Constrict\ResponseInterface; abstract class Middleware implements MiddlewareInterface { - - #[Inject(ResponseInterface::class)] - public ResponseInterface $response; - } diff --git a/http-handler/CoreMiddleware.php b/http-handler/CoreMiddleware.php index 17fddc8e..b0dd99dd 100644 --- a/http-handler/CoreMiddleware.php +++ b/http-handler/CoreMiddleware.php @@ -20,11 +20,11 @@ class CoreMiddleware extends Middleware */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - $this->response->withAccessControlAllowOrigin('*') + $response = response()->withAccessControlAllowOrigin('*') ->withAccessControlRequestMethod($request->getAccessControlRequestMethod()) ->withAccessControlAllowHeaders($request->getAccessControlAllowHeaders()); - var_dump($this->response); + var_dump($response); return $handler->handle($request); }