<?php declare(strict_types=1);
namespace Compra\FoundationSW6\Storefront\Subscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
class Framework implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => 'setCustomXFrameOptions',
];
}
// same origin policy for compra app iframes
public function setCustomXFrameOptions(ResponseEvent $event)
{
$response = $event->getResponse();
$response->headers->set('X-Frame-Options', 'sameorigin');
}
}