Gated static assets: the dashboard shell, its JS, its CSS, the chart library.
(env: Env, request: Request)
| 218 | |
| 219 | /** Gated static assets: the dashboard shell, its JS, its CSS, the chart library. */ |
| 220 | async function serveAsset(env: Env, request: Request): Promise<Response> { |
| 221 | const asset = await env.ASSETS.fetch(request); |
| 222 | const out = withSecurityHeaders(asset); |
| 223 | // Behind a session, so it must never land in a shared cache. |
| 224 | out.headers.set('cache-control', 'private, no-cache'); |
| 225 | out.headers.set('vary', 'cookie'); |
| 226 | return out; |
| 227 | } |
| 228 | |
| 229 | export default { |
| 230 | async fetch(request, env): Promise<Response> { |
no test coverage detected