Commit c11366b
fix(csp): Add nonce to style tag for CSP compliance
The <style> tag in viewer.html was being blocked by CSP after removing
'unsafe-inline' from style-src. This caused the entire UI to render
without any styling.
Fix:
- Add nonce="<!--NONCE-->" attribute to <style> tag in viewer.html
- Add nonce to styleSrc CSP directive in editorController.ts
- Update CLAUDE.md to reflect nonce-based style policy
The nonce placeholder is replaced at runtime with the same nonce used
for scripts, allowing the inline <style> block to pass CSP validation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 58f5d33 commit c11366b
3 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | | - | |
| 236 | + | |
236 | 237 | | |
237 | | - | |
| 238 | + | |
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| |||
0 commit comments