kit icon indicating copy to clipboard operation
kit copied to clipboard

Support CSP `require-trusted-types-for`

Open xamir82 opened this issue 3 years ago • 0 comments

Describe the problem

Even though require-trusted-types-for seems to be present in the list of CSP directives in the configuration, setting it (to script, which is its only value) will actually cause SvelteKit to fail to function properly:

image

Describe the proposed solution

I don't know much about this directive but it seems like what is assigned to innerHTML properties and whatnot, must be a special "trusted" type — see this article.

SvelteKit (or probably Svelte, more specifically) does do a lot of these things (e.g. changing innerHTML properties and so on), so SvelteKit should probably account for this when this directive is enabled.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

xamir82 avatar Dec 07 '22 02:12 xamir82