diff --git a/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php b/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php index 3d7c1f5..211daed 100644 --- a/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php +++ b/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php @@ -58,9 +58,10 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = $response = $this->httpKernel->handle($request, $type, $catch); - // X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags header respectively, when - // either a reverse proxy is being used (so the reverse proxy or CDN can be - // invalidated when appropriate) or when developing/debugging. + // Strip X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags header + // respectively, when either a reverse proxy is being used (so the reverse + // proxy or CDN can be invalidated when appropriate) or when + // developing/debugging. if (!($this->settings->get('reverse_proxy', FALSE) || $this->settings->get('send_cacheability_headers', FALSE))) { $response->headers->remove('X-Drupal-Cache-Tags'); $response->headers->remove('X-Drupal-Cache-Contexts'); diff --git a/core/modules/page_cache/src/Tests/PageCacheTest.php b/core/modules/page_cache/src/Tests/PageCacheTest.php index 8c1a2d3..3e89ffe 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTest.php @@ -52,7 +52,7 @@ protected function setUp() { function testPageCacheTags() { // Ensure that the sending out of the cache tags / contexts is independent // from the page cache. - $this->setCacheHeaders(FALSE); + $this->setCacheabilityHeaders(FALSE); $config = $this->config('system.performance'); $config->set('cache.page.max_age', 300); diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index f06c85f..43e4149 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -813,7 +813,7 @@ protected function initSettings() { // Not using File API; a potential error must trigger a PHP warning. chmod(DRUPAL_ROOT . '/' . $this->siteDirectory, 0777); - $this->setCacheHeaders(); + $this->setCacheabilityHeaders(); } /** @@ -3022,13 +3022,12 @@ protected function assertNoCacheTag($cache_tag) { } /** - * Sets the setting whether to send cacheability headers. + * Enables/disables the cacheability headers. * * @param bool $value * (optional) Should the cache headers be send. */ - protected function setCacheHeaders($value = TRUE) { - // Send cacheability headers so tests can check their values. + protected function setCacheabilityHeaders($value = TRUE) { $settings['settings']['send_cacheability_headers'] = (object) [ 'value' => $value, 'required' => TRUE,