From 31733ba5c05f960f419f1d8cb4a3ae79982d4b0b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 00:54:51 +0000 Subject: [PATCH] Add nosniff header for static runtime responses 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 e5324644b2..6179c1326c 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -165,6 +165,9 @@ async function main() { if (page.status !== 200) { throw new Error(`Smoke test failed: expected web status 200, received ${page.status}.`); } + if (page.headers.get("x-content-type-options") !== "nosniff") { + throw new Error("Smoke test failed: expected x-content-type-options=nosniff."); + } const wsUrl = parsedAppUrl.searchParams.get("ws"); if (!wsUrl) { diff --git a/apps/t3/src/cli.ts b/apps/t3/src/cli.ts index 34b2d5b9d1..d347d60259 100644 --- a/apps/t3/src/cli.ts +++ b/apps/t3/src/cli.ts @@ -552,6 +552,7 @@ function startStaticWebServer(distRoot: string, port: number) { response.statusCode = 200; response.setHeader("Content-Type", contentTypeFor(targetPath)); + response.setHeader("X-Content-Type-Options", "nosniff"); response.end(content); }); });