KernelEvents::REQUEST =>
['onKernelRequest', 9999
],
KernelEvents::RESPONSE =>
['onKernelResponse', 9999
],
];
} public function onKernelRequest(RequestEvent
$event): void
{ if (!
$event->
isMainRequest()) { return;
} $method =
$event->
getRequest()->
getRealMethod();
if ($method === 'OPTIONS'
) { $response =
new Response();
$event->
setResponse($response);
} } public function onKernelResponse(ResponseEvent
$event): void
{ if (!
$event->
isMainRequest()) { return;
}