Skip to content

Commit

Permalink
api.jquery.com: add CSP exception for flickr for /jQuery.getJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Dec 15, 2024
1 parent 8905e99 commit 3d9935c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/api.jquery.com/functions.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

// Allow inline scripts and styles in API demos
// Allow flickr script and images on https://api.jquery.com/jQuery.getJSON/
add_filter( 'jq_content_security_policy', function ( $policy ) {
$policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com";
$policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com api.flickr.com";
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
$policy[ 'img-src' ] = "'self' data: code.jquery.com live.staticflickr.com";
return $policy;
} );

0 comments on commit 3d9935c

Please sign in to comment.