custom/plugins/CompraFoundationSW6/src/Storefront/Subscriber/Framework.php line 19

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Compra\FoundationSW6\Storefront\Subscriber;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Symfony\Component\HttpKernel\KernelEvents;
  5. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  6. class Framework implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             KernelEvents::RESPONSE => 'setCustomXFrameOptions',
  12.         ];
  13.     }
  14.     // same origin policy for compra app iframes
  15.     public function setCustomXFrameOptions(ResponseEvent $event)
  16.     {
  17.         $response $event->getResponse();
  18.         $response->headers->set('X-Frame-Options''sameorigin');
  19.     }
  20. }