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
Using Content Security Policy, we have an error occuring in Sentry SDK.
This document requires 'TrustedScriptURL' assignment.
It occurs on worker instanciation (see screenshot attached)
I traced back to the ts source code sentry-javascript/packages/replay-internal/src/eventBuffer/index.ts
(on the screenshot there are 2 affected resources, one is sentry, the other is vuetify)
This is something that has been done about that in vue, with this PR : vuejs/core#10844
It's about setting an element innerHTML but the part about creating a policy is similar.
Extracts :
// creates the policy
policy = /*#__PURE__*/ tt.createPolicy('vue', {
createHTML: val => val,
})
// define a method to use the policy if exists
const unsafeToTrustedHTML: (value: string) => TrustedHTML | string = policy
? val => policy.createHTML(val)
: val => val
// safe usage to set innerHTML
templateContainer.innerHTML = unsafeToTrustedHTML(the value)
(Or you can configure replayIntegration({ useCompression: false }) to disable compression, but this will result in larger payloads being sent over the network).
I'm going to close this issue, feel free to re-open it if the problem persists!
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/vue
SDK Version
9.2.0
Framework Version
Vue 3.5.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
Using Content Security Policy, we have an error occuring in Sentry SDK.
It occurs on worker instanciation (see screenshot attached)
I traced back to the ts source code sentry-javascript/packages/replay-internal/src/eventBuffer/index.ts
(on the screenshot there are 2 affected resources, one is sentry, the other is vuetify)
This is something that has been done about that in vue, with this PR : vuejs/core#10844
It's about setting an element innerHTML but the part about creating a policy is similar.
Extracts :
Steps to Reproduce
Adding a CSP HTTP header on the server
Exemple :
Thank you for your time.
Expected Result
No CSP error
Actual Result
CSP Error : This document requires 'TrustedScriptURL' assignment.
The text was updated successfully, but these errors were encountered: