If present, reads the request ID from the appropriate header and sets it on a RequestId instance.

@param GetResponseEvent $event
323549
public function onKernelRequest(GetResponseEvent $event)
    {
        $headers = $event->getRequest()->headers;

        if (!$headers->has(self::HEADER_NAME)) {
            return;
        }

        $this->requestId->set($headers->get(self::HEADER_NAME, null, true), true);
    }
850881
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        $currentRoute = $request->attributes->get('_route', '');
        if (mb_stripos($currentRoute, self::ADMIN_ROUTE_PREFIX) !== 0) {
            return;
        }

        $request->attributes->set(self::ADMIN_FLAG_NAME, true);

        $adminEvent = new AdminMatchEvent($event->getRequest(), $event->getRequestType());
        $this->eventDispatcher->dispatch($adminEvent, BlockManagerAdminEvents::ADMIN_MATCH);
    }
347803
public function onKernelRequest(GetResponseEvent $event)
    {
        if (!$event->getRequest()->attributes->get('is_rest_request')) {
            return;
        }

        if (!$this->csrfEnabled) {
            return;
        }

        // skip CSRF validation if no session is running
        if (!$event->getRequest()->getSession()->isStarted()) {
            return;
        }

        if ($this->isMethodSafe($event->getRequest()->getMethod())) {
            return;
        }

        if ($this->isSessionRoute($event->getRequest()->get('_route'))) {
            return;
        }

        if (!$this->checkCsrfToken($event->getRequest())) {
            throw new UnauthorizedException(
                'Missing or invalid CSRF token',
                $event->getRequest()->getMethod() . ' ' . $event->getRequest()->getPathInfo()
            );
        }

        // Dispatching event so that CSRF token intention can be injected into Legacy Stack
        $this->eventDispatcher->dispatch(RestEvents::REST_CSRF_TOKEN_VALIDATED);
    }
886989
public function onKernelRequest(GetResponseEvent $event) {
		if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
			return;
		}

		if ($event->getRequest()->headers->has('x-amz-sns-message-type')) {
			$result = $this->handleSnsNotifications($event);
			$event->setResponse(new Response($result, 200));
		}

		if ($event->getRequest()->headers->has('iron-message-id')) {
			$result = $this->handleIronMqNotifications($event);
			$event->setResponse(new Response($result, 200));
		}
	}
396679
public function onKernelReponse(FilterResponseEvent $event)
    {
        $request  = $event->getRequest();
        $response = $event->getResponse();
        $route    = $this->routes->get($request->attributes->get('_route'));

        if ($route && $route->hasContent() && !$response->headers->has('Last-Modified')) {
            $this->setLastModifiedHeader($route, $request, $response);
        }
    }
536940
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $route = $this->router->getRouteCollection()->get(
            $request->attributes->get('_route')
        );
        if (!$route || !$themeOptions = $route->getOption('synapse_theme')) {
            return;
        }

        $request->attributes->set('synapse_theme', $this->match(
            $themeOptions,
            new ThemeMatchingContext(array(
                'host' => $request->server->get('HTTP_HOST'),
            ))
        ));
    }
414994
public function onRequest(GetResponseEvent $event)
    {
        if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
            return;
        }
        $patterns = $this->provider->getPatterns();
        if ($patterns) {
            foreach ($patterns as $pattern) {
                if ($pattern['matcher']->matches($event->getRequest())) {
                   $firewall = $this->provider->getFirewall($pattern['config']);
                   $firewall->handle();
                }
            }
        }
    }
674060
public function setLocale(GetResponseEvent $event)
    {
        if ($event->isMasterRequest()) {
            $request = $event->getRequest();

            $locale = $this->localeManager->getUserLocale($request);
            $request->setLocale($locale);
        }
    }
1111032
public function onKernelRequest(GetResponseEvent $event)
    {
        $this->setUpRequiredFolders();
        $this->setUpPageTree();
        $this->checkTemplatesSlots();
        $this->setupBootstrapVersion();
        $this->setupConfiguration();
    }
510678
public function onRequest(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $this->manager->initialize($event->getRequest());
    }
934662
public function onKernelRequest(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            // don't do anything if it's not the master request
            return;
        }

        $request = $event->getRequest();

        $session = $this->getContainer()->get('session');

        if ($request->cookies->get('_ga')) {
            $_ga_array = explode('.', $request->cookies->get('_ga'));

            if (isset($_ga_array[2], $_ga_array[3])) {
                $session->set('google_analytics_client_id', $_ga_array[2] . '.' . $_ga_array[3]);
            }
        }

        if ($request->cookies->get('_ym_uid')) {
            $session->set('yandex_metrika_client_id', $request->cookies->get('_ym_uid'));
        }
    }
380299
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();

        if (!$request->attributes->get(FOSRestBundle::ZONE_ATTRIBUTE, true)) {
            return;
        }

        $method = $request->getMethod();
        $contentType = $request->headers->get('Content-Type');
        $normalizeRequest = $this->normalizeForms && $this->isFormRequest($request);

        if ($this->isDecodeable($request)) {
            $format = null === $contentType
                ? $request->getRequestFormat()
                : $request->getFormat($contentType);

            $format = $format ?: $this->defaultFormat;

            $content = $request->getContent();

            if (!$this->decoderProvider->supports($format)) {
                if ($this->throwExceptionOnUnsupportedContentType
                    && $this->isNotAnEmptyDeleteRequestWithNoSetContentType($method, $content, $contentType)
                ) {
                    throw new UnsupportedMediaTypeHttpException("Request body format '$format' not supported");
                }

                return;
            }

            if (!empty($content)) {
                $decoder = $this->decoderProvider->getDecoder($format);
                $data = $decoder->decode($content);
                if (is_array($data)) {
                    $request->request = new ParameterBag($data);
                    $normalizeRequest = true;
                } else {
                    throw new BadRequestHttpException('Invalid '.$format.' message received');
                }
            }
        }

        if (null !== $this->arrayNormalizer && $normalizeRequest) {
            $data = $request->request->all();

            try {
                $data = $this->arrayNormalizer->normalize($data);
            } catch (NormalizationException $e) {
                throw new BadRequestHttpException($e->getMessage());
            }

            $request->request = new ParameterBag($data);
        }
    }
327205
public function onKernelRequest(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        if (!$this->isPlatformUIRequest($event->getRequest())) {
            return;
        }

        $this->globalVariable->setPageLayoutTemplate($this->pageLayoutTemplate);
    }
411409
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        if (Zone::get($request)) {
            return;
        }

        $this->setZone($request);
    }
175466
public function onKernelRequest(GetResponseEvent $event): void
    {
        $request = $event->getRequest();
        if (!$attributes = RequestAttributesExtractor::extractAttributes($request)) {
            return;
        }

        $resourceMetadata = $this->resourceMetadataFactory->create($attributes['resource_class']);

        $isGranted = $resourceMetadata->getOperationAttribute($attributes, 'access_control', null, true);

        if (null === $isGranted) {
            return;
        }

        $extraVariables = $request->attributes->all();
        $extraVariables['object'] = $request->attributes->get('data');
        $extraVariables['request'] = $request;

        if (!$this->resourceAccessChecker->isGranted($attributes['resource_class'], $isGranted, $extraVariables)) {
            throw new AccessDeniedException($resourceMetadata->getOperationAttribute($attributes, 'access_control_message', 'Access Denied.', true));
        }
    }
1228863
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        if (!$strMockedDate = $request->query->get($this->mockParamName)) {
            return;
        }

        $this->mock($strMockedDate);
    }
381211
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $this->requestUri = $request->getRequestUri();

        try {
            $this->session = $request->getSession();
        } catch (\Exception $e) {
            $this->logger->error("Unable to access session: {$e->getMessage()}");
        }
        if ($this->session) {
            try {
                // If context exists in the session, use this information
                if ($this->session->has(static::SESSION_KEY)) {
                    $this->context = $this->session->get(static::SESSION_KEY);
                }
            } catch (\Exception $e) {
                $this->logger->error("Unable to get context from session: {$e->getMessage()}");
            }
        }

        $form = $this->getContextSelectorForm();
        if (!$form) {
            return;
        }
        $form->handleRequest($request);
        // Check if form is submitted and redirect to same url in GET
        if ($form->isSubmitted() && $form->isValid()) {
            $this->setContext($form->getData());
            $redirectResponse = new RedirectResponse($this->requestUri);
            $event->setResponse($redirectResponse);
        }
    }