Include validators on 416 static range responses

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 04:00:21 +00:00
1 parent 9dffec959c
commit 8b93f3b144
2 files changed
+14

No files matched your search

+12
View File
@@ -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.",
+2
View File
@@ -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;
}