From 1db2ef8e82f7d9bb7689e491e21546563845f2e2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:44:49 +0000 Subject: [PATCH] Assert built asset security headers in smoke test Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index fc137117ed..4081a86ecc 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -211,6 +211,12 @@ async function main() { )}.`, ); } + if ((assetResponse.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") { + throw new Error("Smoke test failed: expected nosniff on built asset response."); + } + if ((assetResponse.headers.get("cross-origin-resource-policy") ?? "").toLowerCase() !== "same-origin") { + throw new Error("Smoke test failed: expected CORP header on built asset response."); + } const missingAssetUrl = new URL("/assets/missing-bundle.js", parsedAppUrl); const missingAsset = await fetch(missingAssetUrl); if (missingAsset.status !== 404) {