Documentation
¶
Overview ¶
Package filehttp supplies browser response policy for untrusted stored files. Apply it when streaming file bytes, not when serving an application's UI.
Index ¶
Constants ¶
const SandboxPolicy = "" /* 174-byte string literal not displayed */
SandboxPolicy permits self-contained interactive documents without the application's origin privileges. It permits inline scripts/styles and embedded images, but not external scripts/resources, fetches, forms, workers or frames. Omitting allow-same-origin is essential: adding it restores app-origin access.
Variables ¶
This section is empty.
Functions ¶
func SetHeaders ¶
SetHeaders prepares a stored-file response before any bytes or status are written. download selects attachment disposition; otherwise active documents render inline under SandboxPolicy. Missing/invalid MIME types download as application/octet-stream. Stored metadata and bytes are never modified. Additional CSP policies are retained, so this cannot weaken an outer policy.
Types ¶
This section is empty.