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

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 Commercial License (PCL)
  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 PCL
  13.  */
  14. namespace Pimcore\Bundle\CoreBundle\EventListener;
  15. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  16. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  17. use Symfony\Component\HttpKernel\KernelEvents;
  18. /**
  19.  * @internal
  20.  */
  21. class PimcoreHeaderListener implements EventSubscriberInterface
  22. {
  23.     public static function getSubscribedEvents()
  24.     {
  25.         return [
  26.             KernelEvents::RESPONSE => 'onKernelResponse',
  27.         ];
  28.     }
  29.     /**
  30.      * @param ResponseEvent $event
  31.      */
  32.     public function onKernelResponse(ResponseEvent $event)
  33.     {
  34.         if ($event->isMainRequest()) {
  35.             $response $event->getResponse();
  36.             $response->headers->set('X-Powered-By''pimcore'true);
  37.         }
  38.     }
  39. }