aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/mock.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/data/mock.php')
-rw-r--r--test/data/mock.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/data/mock.php b/test/data/mock.php
index a34e8f5ac..b76fd521c 100644
--- a/test/data/mock.php
+++ b/test/data/mock.php
@@ -195,22 +195,24 @@ QUnit.assert.ok( true, "mock executed");';
}
protected function cspFrame( $req ) {
- // This is CSP only for browsers with "Content-Security-Policy" header support
- // i.e. no old WebKit or old Firefox
header( "Content-Security-Policy: default-src 'self'; report-uri ./mock.php?action=cspLog" );
header( 'Content-type: text/html' );
echo file_get_contents( __DIR__ . '/csp.include.html' );
}
protected function cspNonce( $req ) {
- // This is CSP only for browsers with "Content-Security-Policy" header support
- // i.e. no old WebKit or old Firefox
$test = $req->query['test'] ? '-' . $req->query['test'] : '';
header( "Content-Security-Policy: script-src 'nonce-jquery+hardcoded+nonce'; report-uri ./mock.php?action=cspLog" );
header( 'Content-type: text/html' );
echo file_get_contents( __DIR__ . '/csp-nonce' . $test . '.html' );
}
+ protected function cspAjaxScript( $req ) {
+ header( "Content-Security-Policy: script-src 'self'; report-uri /base/test/data/mock.php?action=cspLog" );
+ header( 'Content-type: text/html' );
+ echo file_get_contents( __DIR__ . '/csp-ajax-script.html' );
+ }
+
protected function cspLog( $req ) {
file_put_contents( $this->cspFile, 'error' );
}