Skip to content

Commit 92c5e97

Browse files
fix: Fix CSP style directive for Monaco editor (coder#5360)
1 parent 3c9dab3 commit 92c5e97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/site.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ func cspHeaders(next http.Handler) http.Handler {
269269
// https://cdn.jsdelivr.net is used by monaco editor on FE for Syntax Highlight
270270
// https://github.com/suren-atoyan/monaco-react/issues/168
271271
CSPDirectiveScriptSrc: {"'self' https://cdn.jsdelivr.net"},
272+
CSPDirectiveStyleSrc: {"'self' 'unsafe-inline' https://cdn.jsdelivr.net"},
272273
// data: is used by monaco editor on FE for Syntax Highlight
273-
CSPDirectiveFontSrc: {"'self' data:"},
274-
CSPDirectiveStyleSrc: {"'self' 'unsafe-inline'"},
274+
CSPDirectiveFontSrc: {"'self' data:"},
275275
// object-src is needed to support code-server
276276
CSPDirectiveObjectSrc: {"'self'"},
277277
// blob: for loading the pwa manifest for code-server

0 commit comments

Comments
 (0)