diff options
Diffstat (limited to 'test/data/mock.php')
-rw-r--r-- | test/data/mock.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/data/mock.php b/test/data/mock.php index d0ed6f2c1..268ad06ef 100644 --- a/test/data/mock.php +++ b/test/data/mock.php @@ -215,7 +215,7 @@ QUnit.assert.ok( true, "mock executed");'; } protected function cspFrame( $req ) { - header( "Content-Security-Policy: default-src 'self'; report-uri ./mock.php?action=cspLog" ); + header( "Content-Security-Policy: default-src 'self'; require-trusted-types-for 'script'; report-uri ./mock.php?action=cspLog" ); header( 'Content-type: text/html' ); echo file_get_contents( __DIR__ . '/csp.include.html' ); } @@ -228,7 +228,7 @@ QUnit.assert.ok( true, "mock executed");'; } protected function cspAjaxScript( $req ) { - header( "Content-Security-Policy: script-src 'self'; report-uri /base/test/data/mock.php?action=cspLog" ); + header( "Content-Security-Policy: script-src 'self'; report-uri ./mock.php?action=cspLog" ); header( 'Content-type: text/html' ); echo file_get_contents( __DIR__ . '/csp-ajax-script.html' ); } @@ -241,6 +241,12 @@ QUnit.assert.ok( true, "mock executed");'; file_put_contents( $this->cspFile, '' ); } + protected function trustedHtml( $req ) { + header( "Content-Security-Policy: require-trusted-types-for 'script'; report-uri ./mock.php?action=cspLog" ); + header( 'Content-type: text/html' ); + echo file_get_contents( __DIR__ . '/trusted-html.html' ); + } + protected function errorWithScript( $req ) { header( 'HTTP/1.0 404 Not Found' ); if ( isset( $req->query['withScriptContentType'] ) ) { |