# Response headers for the hosted web app (wrangler.jsonc). Workers static assets read this file and never serve it.

# Every page, the app shell for each client route included: revalidated on every load, and no-transform so the edge
# injects nothing into it (Web Analytics' automatic beacon would put a third-party script on /pair, whose URL fragment
# carries a pairing link's secret until the app takes it).
#
# The CSP runs only this origin's own scripts (and the terminal's wasm) and connects only to this origin and the relay:
# the app is relay-only since #458; a relay session's second and third sockets dial the relay's other HTTPS ports (#1418),
# so those ports are listed too. Soniox dictation dials Soniox's own real-time hosts from the page (wss://*.soniox.com,
# the hosts sonioxSocketUrl allows), so the audio and key never pass through Doriterm (#3067). Bringing a Direct address back (#446) means adding its sources to connect-src here,
# or the page's direct dial is refused before the relay fallback. The one inline style is @base-ui/react's scrollbar
# hider (utils/styles.mjs, rendered by react-dom as a hoisted <style>), allowed by its hash; tests/ci/deploy-web.test.ts
# renders that element from the installed package and hashes it, so an upgrade that changes the text fails there. Images
# come only from this origin: nothing loads one from a blob: URL (a download's object URL is an anchor, not an image).
/*
  Cache-Control: public, max-age=0, must-revalidate, no-transform
  X-Content-Type-Options: nosniff
  X-Frame-Options: DENY
  Referrer-Policy: no-referrer
  Content-Security-Policy: default-src 'none'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'sha256-kLmvWqfziFavKtqHqRsb90f006UAK2Dmd0It5Iz2KFA='; img-src 'self' blob:; font-src 'self' data:; connect-src 'self' https://relay-doriface.omo.dev wss://relay-doriface.omo.dev wss://relay-doriface.omo.dev:8443 wss://relay-doriface.omo.dev:2053 wss://*.soniox.com; worker-src 'self'; manifest-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'; object-src 'none'
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Resource-Policy: same-origin

# Hashed build output: a new build gets new names, so these never change in place.
/assets/*
  ! Cache-Control
  Cache-Control: public, max-age=31536000, immutable

# The service worker and the manifest are revalidated on every load, so a release reaches an installed app through the
# worker's update prompt.
/sw.js
  ! Cache-Control
  Cache-Control: no-cache
/manifest.webmanifest
  ! Cache-Control
  Cache-Control: no-cache
  Content-Type: application/manifest+json

# Which version and commit this build is (vite.config.ts): the deploy gate reads it to deploy production only forward.
/build.json
  ! Cache-Control
  Cache-Control: no-cache
