vendor/pimcore/pimcore/bundles/CoreBundle/EventListener/PimcoreHeaderListener.php line 33

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Enterprise License (PEL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  * @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  * @license    http://www.pimcore.org/license     GPLv3 and PEL
  13.  */
  14. namespace Pimcore\Bundle\CoreBundle\EventListener;
  15. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  16. use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
  17. use Symfony\Component\HttpKernel\KernelEvents;
  18. class PimcoreHeaderListener implements EventSubscriberInterface
  19. {
  20.     public static function getSubscribedEvents()
  21.     {
  22.         return [
  23.             KernelEvents::RESPONSE => 'onKernelResponse'
  24.         ];
  25.     }
  26.     /**
  27.      * @param FilterResponseEvent $event
  28.      */
  29.     public function onKernelResponse(FilterResponseEvent $event)
  30.     {
  31.         if ($event->isMasterRequest()) {
  32.             $response $event->getResponse();
  33.             $response->headers->set('X-Powered-By''pimcore'true);
  34.         }
  35.     }
  36. }