You are here

private function CasGatewayAuthSubscriber::addCacheMetadataToResponse in CAS 2.x

Add cache metadata to a response if it supports it.

Parameters

\Symfony\Component\HttpFoundation\Response $response: The response object.

\Drupal\Core\Cache\CacheableMetadata $cacheableMetadata: The cache metadata to add.

1 call to CasGatewayAuthSubscriber::addCacheMetadataToResponse()
CasGatewayAuthSubscriber::onResponse in src/Subscriber/CasGatewayAuthSubscriber.php
Handle response event.

File

src/Subscriber/CasGatewayAuthSubscriber.php, line 371

Class

CasGatewayAuthSubscriber
Event subscriber for implementing CAS gateway authentication.

Namespace

Drupal\cas\Subscriber

Code

private function addCacheMetadataToResponse(Response $response, CacheableMetadata $cacheableMetadata) {
  if ($response instanceof CacheableResponseInterface) {
    $response
      ->addCacheableDependency($cacheableMetadata);
  }
}