Loading includes/bootstrap.inc +1 −1 Original line number Diff line number Diff line Loading @@ -1602,7 +1602,7 @@ function drupal_page_header() { */ function drupal_serve_page_from_cache(stdClass $cache) { // Negotiate whether to use compression. $page_compression = !empty($cache->data['page_compressed']); $page_compression = !empty($cache->data['page_compressed']) && !empty($cache->data['body']); $return_compressed = $page_compression && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE; // Get headers set in hook_boot(). Keys are lower-case. Loading modules/simpletest/tests/bootstrap.test +3 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), 'Site title matches.'); $this->assertRaw('</html>', 'Page was not compressed.'); // Verify that an empty page doesn't throw an error when being decompressed. $this->drupalGet('system-test/empty-page'); // Disable compression mode. variable_set('page_compression', FALSE); Loading modules/simpletest/tests/system_test.module +13 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,13 @@ function system_test_menu() { 'type' => MENU_CALLBACK, ); $items['system-test/empty-page'] = array( 'title' => 'Test page cache with empty page.', 'page callback' => 'system_test_empty_page', 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); return $items; } Loading Loading @@ -532,6 +539,12 @@ function system_test_drupal_get_filename_with_schema_rebuild() { return ''; } /** * Page callback to output an empty page. */ function system_test_empty_page() { } /** * Implements hook_watchdog(). */ Loading Loading
includes/bootstrap.inc +1 −1 Original line number Diff line number Diff line Loading @@ -1602,7 +1602,7 @@ function drupal_page_header() { */ function drupal_serve_page_from_cache(stdClass $cache) { // Negotiate whether to use compression. $page_compression = !empty($cache->data['page_compressed']); $page_compression = !empty($cache->data['page_compressed']) && !empty($cache->data['body']); $return_compressed = $page_compression && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE; // Get headers set in hook_boot(). Keys are lower-case. Loading
modules/simpletest/tests/bootstrap.test +3 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), 'Site title matches.'); $this->assertRaw('</html>', 'Page was not compressed.'); // Verify that an empty page doesn't throw an error when being decompressed. $this->drupalGet('system-test/empty-page'); // Disable compression mode. variable_set('page_compression', FALSE); Loading
modules/simpletest/tests/system_test.module +13 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,13 @@ function system_test_menu() { 'type' => MENU_CALLBACK, ); $items['system-test/empty-page'] = array( 'title' => 'Test page cache with empty page.', 'page callback' => 'system_test_empty_page', 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); return $items; } Loading Loading @@ -532,6 +539,12 @@ function system_test_drupal_get_filename_with_schema_rebuild() { return ''; } /** * Page callback to output an empty page. */ function system_test_empty_page() { } /** * Implements hook_watchdog(). */ Loading