From 4ed98327948601615a6c8cfbfd7c59a100791dab Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 03:12:38 +0000 Subject: [PATCH] Assert 304 responses omit content-length in smoke Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index f3a103c827..89fe73c60b 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -273,6 +273,12 @@ async function main() { if ((conditionalAsset.headers.get("cache-control") ?? "").toLowerCase() !== assetCacheControl) { throw new Error("Smoke test failed: expected cache-control preserved on conditional asset response."); } + const conditionalAssetContentLength = conditionalAsset.headers.get("content-length"); + if (conditionalAssetContentLength !== null && conditionalAssetContentLength !== "0") { + throw new Error( + `Smoke test failed: expected no content-length (or 0) on conditional asset response, got ${conditionalAssetContentLength}.`, + ); + } const weakConditionalAsset = await fetch(assetUrl, { headers: { "If-None-Match": `W/${assetEtag}`, @@ -306,6 +312,15 @@ async function main() { "Smoke test failed: expected cache-control preserved on conditional HEAD asset response.", ); } + const conditionalHeadAssetContentLength = conditionalHeadAsset.headers.get("content-length"); + if ( + conditionalHeadAssetContentLength !== null && + conditionalHeadAssetContentLength !== "0" + ) { + throw new Error( + `Smoke test failed: expected no content-length (or 0) on conditional HEAD asset response, got ${conditionalHeadAssetContentLength}.`, + ); + } const rangeEnd = Math.min(15, assetContentLength - 1); const rangedAsset = await fetch(assetUrl, { headers: {