File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ function jq_image_posted_on() {
255
255
/**
256
256
* Content Security Policy
257
257
*/
258
- function jq_content_security_policy ( $ headers ) {
258
+ function jq_content_security_policy () {
259
259
$ nonce = bin2hex ( random_bytes ( 8 ) );
260
260
$ policy = array (
261
261
'default-src ' => "'self' " ,
@@ -285,9 +285,7 @@ function jq_content_security_policy( $headers ) {
285
285
$ policy_string .= $ key . ' ' . $ value . '; ' ;
286
286
}
287
287
288
- $ headers [] = 'Content-Security-Policy: ' . $ policy_string ;
289
-
290
- return $ headers ;
288
+ header ( 'Content-Security-Policy: ' . $ policy_string );
291
289
}
292
290
293
- add_filter ( 'wp_headers ' , 'jq_content_security_policy ' );
291
+ add_action ( 'send_headers ' , 'jq_content_security_policy ' );
You can’t perform that action at this time.
0 commit comments