X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cc10d1ddfc652f6bcf3bbf61d5ec2e2861394c03..refs/pull/5429/head:/tests/SecurityHeaderTest.php diff --git a/tests/SecurityHeaderTest.php b/tests/SecurityHeaderTest.php index d369e695c..5d354e553 100644 --- a/tests/SecurityHeaderTest.php +++ b/tests/SecurityHeaderTest.php @@ -139,6 +139,18 @@ class SecurityHeaderTest extends TestCase $this->assertEquals('frame-src \'self\' https://example.com https://diagrams.example.com', $scriptHeader); } + public function test_frame_src_csp_header_drawio_host_includes_port_if_existing() + { + config()->set([ + 'app.iframe_sources' => 'https://example.com', + 'services.drawio' => 'https://diagrams.example.com:8080/testing?cat=dog', + ]); + + $resp = $this->get('/'); + $scriptHeader = $this->getCspHeader($resp, 'frame-src'); + $this->assertEquals('frame-src \'self\' https://example.com https://diagrams.example.com:8080', $scriptHeader); + } + public function test_cache_control_headers_are_set_on_responses() { // Public access