Skip to content

Instantly share code, notes, and snippets.

@fabpot

fabpot/floc.php Secret

Created April 29, 2021 14:33
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabpot/e8734923ae52b6faf6287de01d679739 to your computer and use it in GitHub Desktop.
Save fabpot/e8734923ae52b6faf6287de01d679739 to your computer and use it in GitHub Desktop.
<?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