private function HttpCache::isPrivateRequest

Checks if the Request includes authorization or other sensitive information that should cause the Response to be considered private by default.

Parameters

Request $request A Request instance:

Return value

Boolean true if the Request is private, false otherwise

1 call to HttpCache::isPrivateRequest()
HttpCache::fetch in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
Forwards the Request to the backend and determines whether the response should be stored.

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php, line 629

Class

HttpCache
Cache provides HTTP caching.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

private function isPrivateRequest(Request $request) {
  foreach ($this->options['private_headers'] as $key) {
    $key = strtolower(str_replace('HTTP_', '', $key));
    if ('cookie' === $key) {
      if (count($request->cookies
        ->all())) {
        return true;
      }
    }
    elseif ($request->headers
      ->has($key)) {
      return true;
    }
  }
  return false;
}