4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\EventListener;
14 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
16 use Symfony\Component\HttpKernel\KernelEvents;
21 * @author Magnus Nordlander <magnus@fervo.se>
23 class ValidateRequestListener implements EventSubscriberInterface
26 * Performs the validation.
28 public function onKernelRequest(GetResponseEvent $event)
30 if (!$event->isMasterRequest()) {
33 $request = $event->getRequest();
35 if ($request::getTrustedProxies()) {
36 $request->getClientIps();
45 public static function getSubscribedEvents()
48 KernelEvents::REQUEST => array(
49 array('onKernelRequest', 256),