Open olix21 opened 5 years ago
Yes sounds like that might be correct, feel free to send a PR with a fix
I cannot reproduce this somehow, kernel.response still fires for me after kernel.exception is used to generate a response.. Can anyone still repro this?
Hi @Seldaek, this is occurred when you throw some exception in event listener. When exception is thrown in controller everything is ok
Edit: For example event Symfony\Component\HttpKernel\Event\RequestEvent
Hello,
We are using NelmioCorsBundle in an API and if an exception is sent, Symfony does not trigger the
kernel.response
event but thekernel.exception
one.So the Access-Control-Allow-Origin is not set. It's a little bit annoying as if the http client send a wrong request, the request will blocked by the CORS instead of returning the reason.
Shouldn't we add
$this->dispatcher->addListener('kernel.exception', array($this, 'onKernelResponse'), 0);
?