function DenyPrivateImageStyleDownload::check

Same name in other branches
  1. 9 core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php \Drupal\image\PageCache\DenyPrivateImageStyleDownload::check()
  2. 8.9.x core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php \Drupal\image\PageCache\DenyPrivateImageStyleDownload::check()
  3. 10 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.