diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index ed1e8a5382..455603fc57 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -352,6 +352,12 @@ async function main() { `Smoke test failed: expected If-Match mismatch status 412, received ${ifMatchMismatchAsset.status}.`, ); } + if ((ifMatchMismatchAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error("Smoke test failed: expected cache-control=no-store on If-Match mismatch response."); + } + if ((ifMatchMismatchAsset.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") { + throw new Error("Smoke test failed: expected nosniff on If-Match mismatch response."); + } const staleUnmodifiedSince = new Date(parsedLastModifiedMs - 1_000).toUTCString(); const ifUnmodifiedSinceStaleAsset = await fetch(assetUrl, { headers: { @@ -363,6 +369,11 @@ async function main() { `Smoke test failed: expected stale If-Unmodified-Since status 412, received ${ifUnmodifiedSinceStaleAsset.status}.`, ); } + if ((ifUnmodifiedSinceStaleAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error( + "Smoke test failed: expected cache-control=no-store on stale If-Unmodified-Since response.", + ); + } const ifUnmodifiedSinceCurrentAsset = await fetch(assetUrl, { headers: { "If-Unmodified-Since": assetLastModified, @@ -455,6 +466,11 @@ async function main() { `Smoke test failed: expected HEAD If-Match mismatch status 412, received ${ifMatchMismatchHeadAsset.status}.`, ); } + if ((ifMatchMismatchHeadAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error( + "Smoke test failed: expected cache-control=no-store on HEAD If-Match mismatch response.", + ); + } const rangeEnd = Math.min(15, assetContentLength - 1); const rangedAsset = await fetch(assetUrl, { headers: {