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); }); });