Commit fe964980 authored by alexpott's avatar alexpott

Issue #1833442 follow-up by olli, ParisLiakos, dawehner: Remove hook_boot().

parent b4b6e9f0
......@@ -1369,9 +1369,8 @@ function drupal_serve_page_from_cache(stdClass $cache) {
// cookie. The Vary header is used to indicates the set of request-header
// fields that fully determines whether a cache is permitted to use the
// response to reply to a subsequent request for a given URL without
// revalidation. If a Vary header has been set in hook_boot(), it is assumed
// that the module knows how to cache the page.
if (!isset($boot_headers['vary']) && !settings()->get('cache.page.omit_vary_cookie')) {
// revalidation.
if (!isset($boot_headers['vary']) && !settings()->get('omit_vary_cookie')) {
header('Vary: Cookie');
}
......
......@@ -343,7 +343,7 @@ function testUILanguageNegotiation() {
'message' => 'URL (DOMAIN) > DEFAULT: default domain should get default language',
),
// Language domain specific URL, we set the $_SERVER['HTTP_HOST'] in
// language_test.module hook_boot() to simulate this.
// \Drupal\language_test\LanguageTestManager to simulate this.
array(
'language_negotiation' => array(LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_SELECTED),
'language_negotiation_url_part' => LANGUAGE_NEGOTIATION_URL_DOMAIN,
......
......@@ -124,6 +124,15 @@ function testPageCache() {
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
// Check the omit_vary_cookie setting.
$this->drupalLogout();
$settings['settings']['omit_vary_cookie'] = (object) array(
'value' => TRUE,
'required' => TRUE,
);
$this->writeSettings($settings);
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
$this->assertTrue(strpos($this->drupalGetHeader('Vary'), 'Cookie') === FALSE, 'Vary: Cookie header was not sent.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment