Skip to content

Commit 231b867

Browse files
katinthehatsiteKateryna Kodonenko
andauthored
Studio: Ensure that images render correctly with the new library (#3317)
## Related issues <!-- Link a related issue to this PR. If the PR does not immediately resolve the issue, for example, it requires a separate deployment to production, avoid using the "Fixes" keyword and use "Related to" instead. --> Related to STU-1668 ## How AI was used in this PR The change was straightforward, it was not needed ## Proposed Changes This PR ensures that we whitelist `https://blueprintslibraryv2.wpcomstaging.com/` where the new blueprints library is located: https://blueprintslibraryv2.wpcomstaging.com/ This will ensure that the images are rendered correctly for the blueprints that we use from that library. ## Testing Instructions <!-- Add as many details as possible to help others reproduce the issue and test the fix. "Before / After" screenshots can also be very helpful when the change is visual. --> * Apply the diff from 214152-ghe-Automattic/wpcom * Sandbox the public API * Pull the changes from this branch * Start Studio * Enable the `Enable Blueprints Gallery` feature flag * Click on Add site > Build a new site * Confirm that thumbnails for blueprints are rendering correctly ## Pre-merge Checklist <!-- Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked. Both the PR author and reviewer are responsible for ensuring the checklist is completed. --> - [ ] Have you checked for TypeScript, React or other console errors? --------- Co-authored-by: Kateryna Kodonenko <kateryna@automattic.com>
1 parent 134a6c2 commit 231b867

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/studio/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' https://public-api.wordpress.com https://api.wordpress.org https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://unpkg.com https://cdn.jsdelivr.net https://wordpress.github.io https://raw.githubusercontent.com ws://localhost:*; img-src 'self' https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://wordpress.github.io https://raw.githubusercontent.com data:;">
6+
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' https://public-api.wordpress.com https://api.wordpress.org https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://blueprintslibraryv2.wpcomstaging.com https://unpkg.com https://cdn.jsdelivr.net https://wordpress.github.io https://raw.githubusercontent.com ws://localhost:*; img-src 'self' https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://blueprintslibraryv2.wpcomstaging.com https://wordpress.github.io https://raw.githubusercontent.com data:;">
77
<title>WordPress Studio</title>
88
</head>
99
<body class="a8c-body">

‎apps/studio/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ async function appBoot() {
306306
const basePolicies = [
307307
"default-src 'self'", // Allow resources from these domains
308308
"script-src-attr 'none'",
309-
"img-src 'self' https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://wordpress.github.io https://raw.githubusercontent.com data:",
309+
"img-src 'self' https://*.gravatar.com https://*.wp.com https://blueprintlibrary.wordpress.com https://blueprintslibraryv2.wpcomstaging.com https://wordpress.github.io https://raw.githubusercontent.com data:",
310310
"style-src 'self' 'unsafe-inline'", // unsafe-inline used by tailwindcss in development, and also in production after the app rename
311311
"script-src 'self' 'wasm-unsafe-eval'", // allow WebAssembly to compile and instantiate
312312
// Site preview uses `<webview>` to host local WordPress sites

0 commit comments

Comments
 (0)