# Strict Content-Security-Policy for the Scalar UI shell _(no submodules)_ ## Purpose The headers module builds the `Content-Security-Policy` header value emitted on every HTML response from the Scalar UI handler. The default posture is conservative: `default-src 'self'` plus the minimum set of directive relaxations the Scalar shell needs to render. In `assetMode = "cdn"` the policy is widened (per-handler) to whitelist the configured Scalar CDN origin. In `assetMode = "bundled"` the policy stays strict — every script/style/font load resolves to the host's own origin under `/assets/`. ## Features - `buildCspHeader({ assetMode, cdnOrigin?, openapiOrigin? })` — emits the `Content-Security-Policy` header pair. - `originOf(url)` — extracts the origin portion of a URL or returns `undefined` for non-URL inputs (used at handler construction to derive the CDN + OpenAPI origins from the parsed options). - `cspAllowsInlineScripts(headerValue)` — conformance predicate the handler test uses to prove the rendered policy never permits inline scripts. The Scalar bootstrap is loaded as an external `