Mark static error responses as no-store

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:19:35 +00:00
1 parent a04f832761
commit 7957e29cbf
2 files changed
+4

No files matched your search

+3
View File
@@ -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",
+1
View File
@@ -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);
}