X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ee24635e06a8c01d751f80caba47c57f76e8989d..06901b878f2c8057a6f9b7d2e0adfda425c68dee:/tests/SecurityHeaderTest.php diff --git a/tests/SecurityHeaderTest.php b/tests/SecurityHeaderTest.php index 00459ec69..d369e695c 100644 --- a/tests/SecurityHeaderTest.php +++ b/tests/SecurityHeaderTest.php @@ -139,12 +139,17 @@ class SecurityHeaderTest extends TestCase $this->assertEquals('frame-src \'self\' https://example.com https://diagrams.example.com', $scriptHeader); } - public function test_cache_control_headers_are_strict_on_responses_when_logged_in() + public function test_cache_control_headers_are_set_on_responses() { + // Public access + $resp = $this->get('/'); + $resp->assertHeader('Cache-Control', 'no-cache, no-store, private'); + $resp->assertHeader('Expires', 'Sun, 12 Jul 2015 19:01:00 GMT'); + + // Authed access $this->asEditor(); $resp = $this->get('/'); - $resp->assertHeader('Cache-Control', 'max-age=0, no-store, private'); - $resp->assertHeader('Pragma', 'no-cache'); + $resp->assertHeader('Cache-Control', 'no-cache, no-store, private'); $resp->assertHeader('Expires', 'Sun, 12 Jul 2015 19:01:00 GMT'); }