Commit 042f49a
Sentry top error solution (#5779)
**Story card:** [sc-XXXX](URL)
## Because
The most frequently reported Sentry error is a Content Security Policy
(CSP) violation for `Blocked style attribute from 'inline:'`. This is
generating significant noise in Sentry due to nonces causing browsers to
still report inline style/script attributes/elements, even when they are
intended to be allowed.
## This addresses
This PR updates the CSP initializer to explicitly allow
`script_src_elem`, `script_src_attr`, `style_src_elem`, and
`style_src_attr` directives in report-only mode. This change aims to
eliminate the false-positive CSP reports related to inline styles and
scripts, thereby reducing Sentry noise.
## Test instructions
1. Deploy this change.
2. Monitor Sentry for the `Blocked style attribute from 'inline:'` error
(specifically `style-src-attr` CSP reports).
3. Confirm that the volume of these specific CSP reports significantly
decreases or is eliminated.
---
<p><a
href="https://cursor.com/agents/bc-7631f173-1bf8-44bb-8dc5-a79b6e7c9373"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/background-agent?bcId=bc-7631f173-1bf8-44bb-8dc5-a79b6e7c9373"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </p>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Igbanam <igbanam@users.noreply.github.com>1 parent 03984a9 commit 042f49a
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
0 commit comments