custom/plugins/b2bsellerscore/addons/B2bOffer/Subscriber/ResponseSubscriber.php line 20

Open in your IDE?
  1. <?php
  2. namespace B2bOffer\Subscriber;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  5. use Symfony\Component\HttpKernel\KernelEvents;
  6. class ResponseSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             KernelEvents::RESPONSE => 'setXFrameOptions',
  12.         ];
  13.     }
  14.     public function setXFrameOptions(ResponseEvent $event): void
  15.     {
  16.         if($event->getRequest()->attributes->get('allow_x_frame_options'false)) {
  17.             $event->getResponse()->headers->set('X-Frame-Options''*');
  18.         }
  19.     }
  20. }