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

Breadcrumb

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

function AbstractSurrogate::needsParsing

Overrides SurrogateInterface::needsParsing

File

vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php, line 60

Class

AbstractSurrogate
Abstract class implementing Surrogate capabilities to Request and Response instances.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function needsParsing(Response $response) : bool {
    if (!($control = $response->headers
        ->get('Surrogate-Control'))) {
        return false;
    }
    $pattern = \sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
    return (bool) preg_match($pattern, $control);
}

API Navigation

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