Documentation
¶
Overview ¶
Package web serves the embedded single-page app and sets security headers.
Index ¶
Constants ¶
View Source
const ContentSecurityPolicy = "default-src 'self'; " +
"script-src 'self'; " +
"style-src 'self' 'unsafe-inline'; " +
"img-src 'self' data: https:; " +
"font-src 'self' data:; " +
"connect-src 'self' ws: wss:; " +
"worker-src 'self' blob:; " +
"child-src 'self' blob:; " +
"object-src 'none'; " +
"base-uri 'self'; " +
"form-action 'self'; " +
"frame-ancestors 'none'"
ContentSecurityPolicy is applied to every response. Scripts must come from our origin only; inline styles are allowed because Radix/sonner set them at runtime. Avatars may be loaded from IdPs over https. Workers may be spawned from self or blob: URLs (e.g. browser extensions, client background jobs).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SPA ¶
type SPA struct {
// contains filtered or unexported fields
}
SPA serves static files from fsys with an index.html fallback for client routes. Hashed assets under /assets/ are cached immutably; index.html is never cached so deployments take effect immediately.
Click to show internal directories.
Click to hide internal directories.