Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpCache.php

function HttpCache::isPrivateRequest

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

1 call to HttpCache::isPrivateRequest()
HttpCache::forward in vendor/symfony/http-kernel/HttpCache/HttpCache.php
Forwards the Request to the backend and returns the Response.

File

vendor/symfony/http-kernel/HttpCache/HttpCache.php, line 673

Class

HttpCache
Cache provides HTTP caching.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

private function isPrivateRequest(Request $request) : bool {
    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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal