-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support CSP require-trusted-types-for #7975
Copy link
Copy link
Closed
Labels
p3-edge-caseSvelteKit cannot be used in an uncommon waySvelteKit cannot be used in an uncommon wayready to implementplease submit PRs for these issues!please submit PRs for these issues!
Milestone
Metadata
Metadata
Assignees
Labels
p3-edge-caseSvelteKit cannot be used in an uncommon waySvelteKit cannot be used in an uncommon wayready to implementplease submit PRs for these issues!please submit PRs for these issues!
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the problem
Even though
require-trusted-types-forseems to be present in the list of CSP directives in the configuration, setting it (toscript, which is its only value) will actually cause SvelteKit to fail to function properly:Describe the proposed solution
I don't know much about this directive but it seems like what is assigned to
innerHTMLproperties 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
innerHTMLproperties 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