Assert Last-Modified stability on conditional responses
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
d81c547169
commit
2ba14edf36
1 file changed
+14
@@ -292,6 +292,13 @@ async function main() {
|
||||
if ((conditionalAsset.headers.get("vary") ?? "").toLowerCase() !== "range") {
|
||||
throw new Error("Smoke test failed: expected vary=range on conditional asset response.");
|
||||
}
|
||||
if (conditionalAsset.headers.get("last-modified") !== assetLastModified) {
|
||||
throw new Error(
|
||||
`Smoke test failed: expected conditional asset last-modified ${assetLastModified}, got ${String(
|
||||
conditionalAsset.headers.get("last-modified"),
|
||||
)}.`,
|
||||
);
|
||||
}
|
||||
const conditionalAssetContentLength = conditionalAsset.headers.get("content-length");
|
||||
if (conditionalAssetContentLength !== null && conditionalAssetContentLength !== "0") {
|
||||
throw new Error(
|
||||
@@ -373,6 +380,13 @@ async function main() {
|
||||
if ((conditionalHeadAsset.headers.get("vary") ?? "").toLowerCase() !== "range") {
|
||||
throw new Error("Smoke test failed: expected vary=range on conditional HEAD asset response.");
|
||||
}
|
||||
if (conditionalHeadAsset.headers.get("last-modified") !== assetLastModified) {
|
||||
throw new Error(
|
||||
`Smoke test failed: expected conditional HEAD asset last-modified ${assetLastModified}, got ${String(
|
||||
conditionalHeadAsset.headers.get("last-modified"),
|
||||
)}.`,
|
||||
);
|
||||
}
|
||||
const conditionalHeadAssetContentLength = conditionalHeadAsset.headers.get("content-length");
|
||||
if (
|
||||
conditionalHeadAssetContentLength !== null &&
|
||||
|
||||
Reference in new issue
Block a user