]> BookStack Code Mirror - bookstack/blobdiff - tests/SecurityHeaderTest.php
Modernize third party services' logos
[bookstack] / tests / SecurityHeaderTest.php
index fe25ef3f00b6a95de8021c7f99b53a82495a910b..10551fc55a8d6dd90d7bf0f66ad430a8e9aee50c 100644 (file)
@@ -119,12 +119,22 @@ class SecurityHeaderTest extends TestCase
         $this->assertEquals('base-uri \'self\'', $scriptHeader);
     }
 
+    public function test_cache_control_headers_are_strict_on_responses_when_logged_in()
+    {
+        $this->asEditor();
+        $resp = $this->get('/');
+        $resp->assertHeader('Cache-Control', 'max-age=0, no-store, private');
+        $resp->assertHeader('Pragma', 'no-cache');
+        $resp->assertHeader('Expires', 'Sun, 12 Jul 2015 19:01:00 GMT');
+    }
+
     /**
      * Get the value of the first CSP header of the given type.
      */
     protected function getCspHeader(TestResponse $resp, string $type): string
     {
         $cspHeaders = collect($resp->headers->all('Content-Security-Policy'));
+
         return $cspHeaders->filter(function ($val) use ($type) {
             return strpos($val, $type) === 0;
         })->first() ?? '';