Assert If-Unmodified-Since failures override If-None-Match
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
2b33d2881c
commit
396d1c311b
1 file changed
+11
@@ -475,6 +475,17 @@ async function main() {
|
||||
);
|
||||
}
|
||||
const staleUnmodifiedSince = new Date(parsedLastModifiedMs - 1_000).toUTCString();
|
||||
const staleUnmodifiedWithNoneMatchAsset = await fetch(assetUrl, {
|
||||
headers: {
|
||||
"If-Unmodified-Since": staleUnmodifiedSince,
|
||||
"If-None-Match": assetEtag,
|
||||
},
|
||||
});
|
||||
if (staleUnmodifiedWithNoneMatchAsset.status !== 412) {
|
||||
throw new Error(
|
||||
`Smoke test failed: expected stale If-Unmodified-Since + If-None-Match status 412, received ${staleUnmodifiedWithNoneMatchAsset.status}.`,
|
||||
);
|
||||
}
|
||||
const ifUnmodifiedSinceStaleAsset = await fetch(assetUrl, {
|
||||
headers: {
|
||||
"If-Unmodified-Since": staleUnmodifiedSince,
|
||||
|
||||
Reference in new issue
Block a user