Skip to content

Commit 92228a4

Browse files
committed
fixup! send csp report header on staging
1 parent 318cea7 commit 92228a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

themes/jquery/functions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ function jq_image_posted_on() {
256256
* Content Security Policy
257257
*/
258258
function jq_content_security_policy() {
259+
if ( !JQUERY_STAGING ) {
260+
return;
261+
}
259262
$nonce = bin2hex( random_bytes( 8 ) );
260263
$policy = array(
261264
'default-src' => "'self'",
@@ -284,7 +287,7 @@ function jq_content_security_policy() {
284287
$policy_string .= $key . ' ' . $value . '; ';
285288
}
286289

287-
header( 'Content-Security-Policy: ' . $policy_string );
290+
header( 'Content-Security-Policy-Report-Only: ' . $policy_string );
288291
}
289292

290293
add_action( 'send_headers', 'jq_content_security_policy' );

0 commit comments

Comments
 (0)