CacheableSecuredRedirectResponse
abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface (View source)
Provides a common base class for cacheable safe redirects.
Traits
Provides an implementation of CacheableResponseInterface.
Properties
| protected CacheableMetadata | $cacheabilityMetadata | The cacheability metadata. |
from CacheableResponseTrait |
Methods
Copies an existing redirect response into a safe one.
Copies over the values from the given response.
Returns whether the URL is considered as safe to redirect to.
Details
static SecuredRedirectResponse
createFromRedirectResponse(RedirectResponse $response)
Copies an existing redirect response into a safe one.
The safe one cannot accidentally redirect to an external URL, unless actively wanted (see TrustedRedirectResponse).
protected
fromResponse(RedirectResponse $response)
Copies over the values from the given response.
SecuredRedirectResponse
setTargetUrl($url)
{@inheritdoc}
abstract protected bool
isSafe(string $url)
Returns whether the URL is considered as safe to redirect to.
addCacheableDependency($dependency)
{@inheritdoc}
getCacheableMetadata()
{@inheritdoc}