Assert HEAD stale If-Unmodified-Since validator headers

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 04:17:08 +00:00
1 parent 587cca9b84
commit 3155e47d99
1 file changed
+10
+10
View File
@@ -645,6 +645,16 @@ async function main() {
"Smoke test failed: expected cache-control=no-store on HEAD stale If-Unmodified-Since response.",
);
}
if (ifUnmodifiedSinceStaleHeadAsset.headers.get("etag") !== assetEtag) {
throw new Error(
"Smoke test failed: expected ETag on HEAD stale If-Unmodified-Since response.",
);
}
if (ifUnmodifiedSinceStaleHeadAsset.headers.get("last-modified") !== assetLastModified) {
throw new Error(
"Smoke test failed: expected Last-Modified on HEAD stale If-Unmodified-Since response.",
);
}
const ifMatchRangeMismatchHeadAsset = await fetch(assetUrl, {
method: "HEAD",
headers: {