+ public function test_frame_src_csp_header_set()
+ {
+ $resp = $this->get('/');
+ $scriptHeader = $this->getCspHeader($resp, 'frame-src');
+ $this->assertEquals('frame-src \'self\' https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com', $scriptHeader);
+ }
+
+ public function test_frame_src_csp_header_has_drawio_host_added()
+ {
+ config()->set([
+ 'app.iframe_sources' => 'https://example.com',
+ 'services.drawio' => 'https://diagrams.example.com/testing?cat=dog',
+ ]);
+
+ $resp = $this->get('/');
+ $scriptHeader = $this->getCspHeader($resp, 'frame-src');
+ $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()
+ {
+ $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');
+ }
+