function DenyPrivateImageStyleDownload::check

Same name and namespace in other branches
  1. 8.9.x core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php \Drupal\image\PageCache\DenyPrivateImageStyleDownload::check()
  2. 10 core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php \Drupal\image\PageCache\DenyPrivateImageStyleDownload::check()
  3. 11.x core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php \Drupal\image\PageCache\DenyPrivateImageStyleDownload::check()

Overrides ResponsePolicyInterface::check

File

core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php, line 38

Class

DenyPrivateImageStyleDownload
Cache policy for image preview page.

Namespace

Drupal\image\PageCache

Code

public function check(Response $response, Request $request) {
    if ($this->routeMatch
        ->getRouteName() === 'image.style_private') {
        return static::DENY;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.