Skip to content

Commit 79f047a

Browse files
gregumolenybernard
authored andcommitted
Don't inject Alertify in case of RedirectResponse
1 parent 19e3818 commit 79f047a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

EventListener/AlertifyListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Troopers\AlertifyBundle\EventListener;
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15+
use Symfony\Component\HttpFoundation\RedirectResponse;
1516
use Symfony\Component\HttpFoundation\Request;
1617
use Symfony\Component\HttpFoundation\Response;
1718
use Symfony\Component\HttpFoundation\Session\Session;
@@ -57,6 +58,10 @@ public function onKernelResponse(FilterResponseEvent $event)
5758
*/
5859
protected function injectAlertify(Response $response, Request $request)
5960
{
61+
if ($response instanceof RedirectResponse) {
62+
return;
63+
}
64+
6065
$content = $response->getContent();
6166
$pos = strripos($content, '</body>');
6267

0 commit comments

Comments
 (0)