Assert wildcard If-None-Match and If-Match behavior

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 03:51:19 +00:00
1 parent 44728d6cd3
commit 82ee14bc7e
1 file changed
+20
+20
View File
@@ -321,6 +321,16 @@ async function main() {
`Smoke test failed: expected weak conditional asset status 304, received ${weakConditionalAsset.status}.`,
);
}
const wildcardConditionalAsset = await fetch(assetUrl, {
headers: {
"If-None-Match": "*",
},
});
if (wildcardConditionalAsset.status !== 304) {
throw new Error(
`Smoke test failed: expected wildcard conditional asset status 304, received ${wildcardConditionalAsset.status}.`,
);
}
const modifiedSinceAsset = await fetch(assetUrl, {
headers: {
"If-Modified-Since": assetLastModified,
@@ -373,6 +383,16 @@ async function main() {
if ((ifMatchMismatchAsset.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") {
throw new Error("Smoke test failed: expected nosniff on If-Match mismatch response.");
}
const ifMatchWildcardAsset = await fetch(assetUrl, {
headers: {
"If-Match": "*",
},
});
if (ifMatchWildcardAsset.status !== 200) {
throw new Error(
`Smoke test failed: expected wildcard If-Match status 200, received ${ifMatchWildcardAsset.status}.`,
);
}
if (ifMatchMismatchAsset.headers.get("etag") !== assetEtag) {
throw new Error("Smoke test failed: expected ETag on If-Match mismatch response.");
}