You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor Content Security Policy (CSP) handling to use a centralized approach:
- Move CSP generation logic to shared/csp.ts
- Use structured CSP directives with base/dev/prod variants
- Implement utility functions for source/nonce injection
- Update ClineProvider to use new CSP generation
Signed-off-by: Eric Wheeler <[email protected]>
@@ -710,21 +703,22 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
710
703
in meta tag we add nonce attribute: A cryptographic nonce (only used once) to allow scripts. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.
711
704
*/
712
705
constnonce=getNonce()
706
+
constcsp=cspGenerate(webview,nonce,false)
713
707
714
708
// Tip: Install the es6-string-html VS Code extension to enable code highlighting below
0 commit comments