for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
class ResponseListener implements EventSubscriberInterface
{
/**
* Add x-frame-options header to mitigate clickjacking
*/
public function onKernelResponse(FilterResponseEvent $event)
$event->getResponse()->headers->set('x-frame-options', 'deny');
}
public static function getSubscribedEvents()
return array(
KernelEvents::RESPONSE => array('onKernelResponse', -1024),
);