Assert HEAD asset content-length in smoke test
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
e8dee9f7b6
commit
4fb9e1769c
1 file changed
+8
@@ -235,6 +235,14 @@ async function main() {
|
||||
`Smoke test failed: expected HEAD asset status 200, received ${headAssetResponse.status}.`,
|
||||
);
|
||||
}
|
||||
const headAssetContentLength = Number(headAssetResponse.headers.get("content-length") ?? "0");
|
||||
if (!Number.isFinite(headAssetContentLength) || headAssetContentLength <= 0) {
|
||||
throw new Error(
|
||||
`Smoke test failed: expected positive content-length on HEAD asset response, got ${String(
|
||||
headAssetResponse.headers.get("content-length"),
|
||||
)}.`,
|
||||
);
|
||||
}
|
||||
const headAssetCacheControl = (headAssetResponse.headers.get("cache-control") ?? "").toLowerCase();
|
||||
if (!headAssetCacheControl.includes("immutable")) {
|
||||
throw new Error(
|
||||
|
||||
Reference in new issue
Block a user