diff options
author | David Rothstein <drothstein@gmail.com> | 2013-12-30 11:38:30 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2013-12-30 11:38:30 -0500 |
commit | 6cd1aae9884952d2eb9750133c85c1c52c3ba26f (patch) | |
tree | bcc0a742dc9453673f486c619afac53e8d2b4af3 /modules/simpletest | |
parent | 001532a06e070f209c2e771720435a3e08c0cc8c (diff) | |
download | brdo-6cd1aae9884952d2eb9750133c85c1c52c3ba26f.tar.gz brdo-6cd1aae9884952d2eb9750133c85c1c52c3ba26f.tar.bz2 |
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.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/bootstrap.test | 12 |
1 files changed, 12 insertions, 0 deletions
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('</html>', '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('</html>', '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('</html>', 'Page was delivered after compression mode is changed (compression support disabled).'); } } |