/** * {@inheritdoc} */ protected function fromResponse(RedirectResponse $response) { parent::fromResponse($response); $metadata = $this->getCacheableMetadata(); if ($response instanceof CacheableResponseInterface) { $metadata->addCacheableDependency($response->getCacheableMetadata()); } else { $metadata->setCacheMaxAge(0); } }
/** * {@inheritdoc} */ public function __construct($url, $status = 302, $headers = array()) { $this->trustedUrls[$url] = TRUE; parent::__construct($url, $status, $headers); }