From d68b1bbc68d76cd371cb3caa5d42ec741d032fa6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 05:20:37 +0000 Subject: [PATCH] Assert conditional 304 content-type header stability Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index 6238ebe0ac..ebb00cfa95 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -245,6 +245,10 @@ async function main() { if (!assetEtag || assetEtag.length === 0) { throw new Error("Smoke test failed: expected ETag on built asset response."); } + const assetContentType = assetResponse.headers.get("content-type"); + if (!assetContentType || assetContentType.length === 0) { + throw new Error("Smoke test failed: expected content-type on built asset response."); + } const assetLastModified = assetResponse.headers.get("last-modified"); if (!assetLastModified || assetLastModified.length === 0) { throw new Error("Smoke test failed: expected Last-Modified on built asset response."); @@ -280,6 +284,13 @@ async function main() { )}.`, ); } + if (conditionalAsset.headers.get("content-type") !== assetContentType) { + throw new Error( + `Smoke test failed: expected conditional asset content-type ${assetContentType}, got ${String( + conditionalAsset.headers.get("content-type"), + )}.`, + ); + } if ((conditionalAsset.headers.get("cache-control") ?? "").toLowerCase() !== assetCacheControl) { throw new Error("Smoke test failed: expected cache-control preserved on conditional asset response."); } @@ -605,6 +616,13 @@ async function main() { )}.`, ); } + if (conditionalHeadAsset.headers.get("content-type") !== assetContentType) { + throw new Error( + `Smoke test failed: expected conditional HEAD asset content-type ${assetContentType}, got ${String( + conditionalHeadAsset.headers.get("content-type"), + )}.`, + ); + } if ((conditionalHeadAsset.headers.get("cache-control") ?? "").toLowerCase() !== assetCacheControl) { throw new Error( "Smoke test failed: expected cache-control preserved on conditional HEAD asset response.",