From 8b93f3b144cc7ad887eb1e65860876abcc35cba1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 04:00:21 +0000 Subject: [PATCH] Include validators on 416 static range responses Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 12 ++++++++++++ apps/t3/src/cli.ts | 2 ++ 2 files changed, 14 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index ce436a5504..d536dea231 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -748,6 +748,12 @@ async function main() { )}, got ${String(unsatisfiableRange.headers.get("content-range"))}.`, ); } + if (unsatisfiableRange.headers.get("etag") !== assetEtag) { + throw new Error("Smoke test failed: expected ETag on unsatisfiable range response."); + } + if (unsatisfiableRange.headers.get("last-modified") !== assetLastModified) { + throw new Error("Smoke test failed: expected Last-Modified on unsatisfiable range response."); + } if ((unsatisfiableRange.headers.get("accept-ranges") ?? "").toLowerCase() !== "bytes") { throw new Error( "Smoke test failed: expected accept-ranges=bytes on unsatisfiable range response.", @@ -887,6 +893,12 @@ async function main() { )}, got ${String(headUnsatisfiableRange.headers.get("content-range"))}.`, ); } + if (headUnsatisfiableRange.headers.get("etag") !== assetEtag) { + throw new Error("Smoke test failed: expected ETag on HEAD unsatisfiable range response."); + } + if (headUnsatisfiableRange.headers.get("last-modified") !== assetLastModified) { + throw new Error("Smoke test failed: expected Last-Modified on HEAD unsatisfiable range response."); + } if ((headUnsatisfiableRange.headers.get("accept-ranges") ?? "").toLowerCase() !== "bytes") { throw new Error( "Smoke test failed: expected accept-ranges=bytes on HEAD unsatisfiable range response.", diff --git a/apps/t3/src/cli.ts b/apps/t3/src/cli.ts index 971ab7d8b8..d68ee55247 100644 --- a/apps/t3/src/cli.ts +++ b/apps/t3/src/cli.ts @@ -943,6 +943,8 @@ function startStaticWebServer(distRoot: string, port: number) { "Content-Range": `bytes */${stats.size}`, "Accept-Ranges": "bytes", Vary: "Range", + ETag: etag, + "Last-Modified": lastModified, }); return; }