@@ -41,13 +41,16 @@ export default function koaSecurityHeaders<StateT, ContextT, ResponseBodyT>(
41
41
/** Google Sign-In (GSI) origin for Google One Tap. */
42
42
const gsiOrigin = 'https://accounts.google.com/gsi/' ;
43
43
44
- // We use react-monaco-editor for code editing in the admin console. It loads the monaco editor asynchronously from a CDN.
44
+ // We have the following use cases:
45
+ //
46
+ // 1. We use `react-monaco-editor` for code editing in the admin console. It loads the monaco
47
+ // editor asynchronously from jsDelivr.
48
+ // 2. We use `mermaid` for rendering diagrams in the admin console. It loads the mermaid library
49
+ // asynchronously from jsDelivr since Parcel has issues with loading it directly in production.
50
+ //
45
51
// Allow the CDN src in the CSP.
46
52
// Allow blob: for monaco editor to load worker scripts
47
- const monacoEditorCDNSource = [
48
- 'https://cdn.jsdelivr.net/npm/[email protected] /min/vs/' ,
49
- 'blob:' ,
50
- ] ;
53
+ const cdnSources = [ 'https://cdn.jsdelivr.net/' , 'blob:' ] ;
51
54
52
55
/**
53
56
* Default Applied rules:
@@ -122,7 +125,7 @@ export default function koaSecurityHeaders<StateT, ContextT, ResponseBodyT>(
122
125
scriptSrc : [
123
126
"'self'" ,
124
127
...conditionalArray ( ! isProduction && [ "'unsafe-eval'" , "'unsafe-inline'" ] ) ,
125
- ...monacoEditorCDNSource ,
128
+ ...cdnSources ,
126
129
] ,
127
130
connectSrc : [ "'self'" , logtoOrigin , ...adminOrigins , ...coreOrigins , ...developmentOrigins ] ,
128
131
// Allow Main Flow origin loaded in preview iframe
0 commit comments