-
-
Save fabpot/e8734923ae52b6faf6287de01d679739 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\EventListener; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpKernel\Event\ResponseEvent; | |
class PermissionsPolicySubscriber implements EventSubscriberInterface | |
{ | |
public function addPermissionsPolicyHeader(ResponseEvent $event): void | |
{ | |
$event->getResponse()->headers->set('permissions-policy', 'interest-cohort=()'); | |
} | |
public static function getSubscribedEvents() | |
{ | |
return [ | |
ResponseEvent::class => 'addPermissionsPolicyHeader', | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment