Skip to content

Commit

Permalink
functions: allow loading styles and images from the jQuery CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil authored Oct 16, 2024
1 parent 7273897 commit 1eaa3fd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion themes/api.jquery.com/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// Allow inline scripts and styles in API demos
add_filter( 'jq_content_security_policy', function ( $policy ) {
$policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com";
$policy[ 'style-src' ] = "'self' 'unsafe-inline'";
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
return $policy;
} );
2 changes: 1 addition & 1 deletion themes/api.jquerymobile.com/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ function jq_mobile_api_version_current() {
// Allow inline scripts and styles in API demos
add_filter( 'jq_content_security_policy', function ( $policy ) {
$policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com";
$policy[ 'style-src' ] = "'self' 'unsafe-inline'";
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
return $policy;
} );
2 changes: 1 addition & 1 deletion themes/api.jqueryui.com/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ function jq_ui_api_version_current() {
// Allow inline scripts and styles in API demos
add_filter( 'jq_content_security_policy', function ( $policy ) {
$policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com";
$policy[ 'style-src' ] = "'self' 'unsafe-inline'";
$policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com";
return $policy;
} );
4 changes: 2 additions & 2 deletions themes/jquery/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ function jq_content_security_policy() {
'default-src' => "'self'",
'script-src' => "'self' 'nonce-$nonce' code.jquery.com",
// The nonce is here so inline scripts can be used in the theme
'style-src' => "'self' 'nonce-$nonce'",
'style-src' => "'self' 'nonce-$nonce' code.jquery.com",
// data: SVG images are used in typesense
'img-src' => "'self' data:",
'img-src' => "'self' data: code.jquery.com",
'connect-src' => "'self' typesense.jquery.com",
'font-src' => "'self'",
'object-src' => "'none'",
Expand Down

0 comments on commit 1eaa3fd

Please sign in to comment.