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: {