From ae24ea691c95186bdc7d23e55b8db0797e61cff8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 04:02:09 +0000 Subject: [PATCH] Assert HEAD stale If-Unmodified-Since failures Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index d536dea231..07d28a39aa 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -579,6 +579,22 @@ async function main() { if (ifMatchMismatchHeadAsset.headers.get("last-modified") !== assetLastModified) { throw new Error("Smoke test failed: expected Last-Modified on HEAD If-Match mismatch response."); } + const ifUnmodifiedSinceStaleHeadAsset = await fetch(assetUrl, { + method: "HEAD", + headers: { + "If-Unmodified-Since": staleUnmodifiedSince, + }, + }); + if (ifUnmodifiedSinceStaleHeadAsset.status !== 412) { + throw new Error( + `Smoke test failed: expected HEAD stale If-Unmodified-Since status 412, received ${ifUnmodifiedSinceStaleHeadAsset.status}.`, + ); + } + if ((ifUnmodifiedSinceStaleHeadAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error( + "Smoke test failed: expected cache-control=no-store on HEAD stale If-Unmodified-Since response.", + ); + } const ifMatchRangeMismatchHeadAsset = await fetch(assetUrl, { method: "HEAD", headers: {