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\HttpCacheCode
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));
}
}