Assert 412 responses keep range capability headers
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
262f9e242c
commit
9ebf691747
1 file changed
+19
@@ -393,6 +393,12 @@ 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.");
|
||||
}
|
||||
if ((ifMatchMismatchAsset.headers.get("accept-ranges") ?? "").toLowerCase() !== "bytes") {
|
||||
throw new Error("Smoke test failed: expected accept-ranges=bytes on If-Match mismatch response.");
|
||||
}
|
||||
if ((ifMatchMismatchAsset.headers.get("vary") ?? "").toLowerCase() !== "range") {
|
||||
throw new Error("Smoke test failed: expected vary=range on If-Match mismatch response.");
|
||||
}
|
||||
const ifMatchLowercaseWeakAsset = await fetch(assetUrl, {
|
||||
headers: {
|
||||
"If-Match": `w/${assetEtag}`,
|
||||
@@ -451,6 +457,11 @@ async function main() {
|
||||
"Smoke test failed: expected cache-control=no-store on stale If-Unmodified-Since response.",
|
||||
);
|
||||
}
|
||||
if ((ifUnmodifiedSinceStaleAsset.headers.get("accept-ranges") ?? "").toLowerCase() !== "bytes") {
|
||||
throw new Error(
|
||||
"Smoke test failed: expected accept-ranges=bytes on stale If-Unmodified-Since response.",
|
||||
);
|
||||
}
|
||||
if (ifUnmodifiedSinceStaleAsset.headers.get("etag") !== assetEtag) {
|
||||
throw new Error("Smoke test failed: expected ETag on stale If-Unmodified-Since response.");
|
||||
}
|
||||
@@ -593,6 +604,14 @@ async function main() {
|
||||
"Smoke test failed: expected cache-control=no-store on HEAD If-Match mismatch response.",
|
||||
);
|
||||
}
|
||||
if ((ifMatchMismatchHeadAsset.headers.get("accept-ranges") ?? "").toLowerCase() !== "bytes") {
|
||||
throw new Error(
|
||||
"Smoke test failed: expected accept-ranges=bytes on HEAD If-Match mismatch response.",
|
||||
);
|
||||
}
|
||||
if ((ifMatchMismatchHeadAsset.headers.get("vary") ?? "").toLowerCase() !== "range") {
|
||||
throw new Error("Smoke test failed: expected vary=range on HEAD If-Match mismatch response.");
|
||||
}
|
||||
if (ifMatchMismatchHeadAsset.headers.get("etag") !== assetEtag) {
|
||||
throw new Error("Smoke test failed: expected ETag on HEAD If-Match mismatch response.");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user