public function replaceKeys(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        if ($this->controller !== $event->getRequest()->attributes->get('_controller')) {
            return;
        }

        $response = $event->getResponse();
        $content = preg_replace($this->pattern, $this->replacement, $response->getContent());
        $response->setContent($content);
    }