removeHeaders example

$scopes = $event->getRequest()->attributes->get(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE, []);

        if (!\in_array(StorefrontRouteScope::ID, $scopes, true) && !$response instanceof StorefrontResponse) {
            return;
        }

        $this->manipulateStorefrontHeader($event->getRequest()$response);
    }

    private function manipulateStorefrontHeader(Request $request, Response $response): void
    {
        $this->removeHeaders($response);
        $this->addNoStoreHeader($request$response);
    }

    private function removeHeaders(Response $response): void
    {
        foreach (self::REMOVAL_HEADERS as $headerKey) {
            $response->headers->remove($headerKey);
        }
    }

    private function addNoStoreHeader(Request $request, Response $response): void
    {
Home | Imprint | This part of the site doesn't use cookies.