This commit is contained in:
2021-09-24 17:56:05 +08:00
parent 47a1b8d191
commit 152600f985
2 changed files with 2 additions and 6 deletions
-4
View File
@@ -13,8 +13,4 @@ use Server\Constrict\ResponseInterface;
abstract class Middleware implements MiddlewareInterface
{
#[Inject(ResponseInterface::class)]
public ResponseInterface $response;
}
+2 -2
View File
@@ -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);
}