From 7957e29cbfa9dc6c245b3b5fc92b72b1744d5366 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:19:35 +0000 Subject: [PATCH] Mark static error responses as no-store Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 3 +++ apps/t3/src/cli.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index 43cd66f661..62d367bffe 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -185,6 +185,9 @@ async function main() { if ((missingAsset.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") { throw new Error("Smoke test failed: expected nosniff on missing asset response."); } + if ((missingAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error("Smoke test failed: expected cache-control=no-store on missing asset."); + } const postPage = await fetch(parsedAppUrl, { method: "POST", body: "noop", diff --git a/apps/t3/src/cli.ts b/apps/t3/src/cli.ts index 895dacf287..1baf2af348 100644 --- a/apps/t3/src/cli.ts +++ b/apps/t3/src/cli.ts @@ -571,6 +571,7 @@ function startStaticWebServer(distRoot: string, port: number) { response.setHeader("Content-Type", "text/plain; charset=utf-8"); response.setHeader("Content-Length", String(body.byteLength)); response.setHeader("X-Content-Type-Options", "nosniff"); + response.setHeader("Cache-Control", "no-store"); for (const [key, value] of Object.entries(extraHeaders)) { response.setHeader(key, value); }