src/Graviton/RestBundle/Listener/XVersionResponseListener.php
public function onKernelResponse(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            // don't do anything if it's not the master request
            return;
        }

        $event->getResponse()->headers->set(
            'X-Version',
            $this->versionHeader
        );
    }
public function onKernelResponse(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            // don't do anything if it's not the master request
            return;
        }

        $event->getResponse()->headers->set(
            'X-Version',
            $this->versionHeader
        );
    }
public function onKernelResponse ( FilterResponseEvent $ event ) { if ( ! $ event -> isMasterRequest ( ) ) { // don't do anything if it's not the master request return ; } $ event -> getResponse ( ) -> headers -> set ( 'X-Version' , $ this -> versionHeader ) ; }
Adds a X-Version header to the response.

@param FilterResponseEvent $event Current emitted event.

@return void
Adds a X - Version header to the response .