Skip to main content

shell_csp

Function shell_csp 

Source
pub fn shell_csp(app: &AppIdentity, html: &str) -> HeaderValue
Expand description

The policy for one rendering of the SPA shell: the base policy plus a 'sha256-…' source for each inline <script> the shell actually contains, and the app’s frame-src when it has one (AppIdentity::spa_frame_src).

Computed from the served bytes rather than baked in, so it stays correct across SPA rebuilds (SvelteKit’s bootstrap script changes every build) and across the token we inject into it.