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

Breadcrumb

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

function AbstractSurrogate::removeFromControl

Remove the Surrogate from the Surrogate-Control header.

2 calls to AbstractSurrogate::removeFromControl()
Esi::process in vendor/symfony/http-kernel/HttpCache/Esi.php
Replaces a Response Surrogate tags with the included resource content.
Ssi::process in vendor/symfony/http-kernel/HttpCache/Ssi.php
Replaces a Response Surrogate tags with the included resource content.

File

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

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

protected function removeFromControl(Response $response) : void {
    if (!$response->headers
        ->has('Surrogate-Control')) {
        return;
    }
    $value = $response->headers
        ->get('Surrogate-Control');
    $upperName = strtoupper($this->getName());
    if (\sprintf('content="%s/1.0"', $upperName) == $value) {
        $response->headers
            ->remove('Surrogate-Control');
    }
    elseif (preg_match(\sprintf('#,\\s*content="%s/1.0"#', $upperName), $value)) {
        $response->headers
            ->set('Surrogate-Control', preg_replace(\sprintf('#,\\s*content="%s/1.0"#', $upperName), '', $value));
    }
    elseif (preg_match(\sprintf('#content="%s/1.0",\\s*#', $upperName), $value)) {
        $response->headers
            ->set('Surrogate-Control', preg_replace(\sprintf('#content="%s/1.0",\\s*#', $upperName), '', $value));
    }
}

API Navigation

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