mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
fix: Fix CSP for monaco editor (#5358)
This commit is contained in:
@ -266,8 +266,11 @@ func cspHeaders(next http.Handler) http.Handler {
|
||||
CSPDirectiveDefaultSrc: {"'self'"},
|
||||
CSPDirectiveConnectSrc: {"'self'"},
|
||||
CSPDirectiveChildSrc: {"'self'"},
|
||||
CSPDirectiveScriptSrc: {"'self'"},
|
||||
CSPDirectiveFontSrc: {"'self'"},
|
||||
// https://cdn.jsdelivr.net is used by monaco editor on FE for Syntax Highlight
|
||||
// https://github.com/suren-atoyan/monaco-react/issues/168
|
||||
CSPDirectiveScriptSrc: {"'self' https://cdn.jsdelivr.net"},
|
||||
// data: is used by monaco editor on FE for Syntax Highlight
|
||||
CSPDirectiveFontSrc: {"'self' data:"},
|
||||
CSPDirectiveStyleSrc: {"'self' 'unsafe-inline'"},
|
||||
// object-src is needed to support code-server
|
||||
CSPDirectiveObjectSrc: {"'self'"},
|
||||
|
Reference in New Issue
Block a user