Assert built asset security headers in smoke test

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:44:49 +00:00
1 parent 9b3ffaa235
commit 1db2ef8e82
1 file changed
+6
+6
View File
@@ -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) {