From 6cd1aae9884952d2eb9750133c85c1c52c3ba26f Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 30 Dec 2013 11:38:30 -0500 Subject: Issue #1476810 by Spleshka, David_Rothstein, franz | Heine: Drupal_serve_page_from_cache can serve uncompressed data with Content-Encoding gzip header with page_cache_without_database = 1. --- modules/simpletest/tests/bootstrap.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test index 87b59608e..4fda15c8c 100644 --- a/modules/simpletest/tests/bootstrap.test +++ b/modules/simpletest/tests/bootstrap.test @@ -219,6 +219,18 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { $this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.'); $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), 'Site title matches.'); $this->assertRaw('', 'Page was not compressed.'); + + // Disable compression mode. + variable_set('page_compression', FALSE); + + // Verify if cached page is still available for a client with compression support. + $this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate')); + $this->drupalSetContent(gzinflate(substr($this->drupalGetContent(), 10, -8))); + $this->assertRaw('', 'Page was delivered after compression mode is changed (compression support enabled).'); + + // Verify if cached page is still available for a client without compression support. + $this->drupalGet(''); + $this->assertRaw('', 'Page was delivered after compression mode is changed (compression support disabled).'); } } -- cgit v1.2.3