Assert conditional 304 content-type header stability

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 05:20:37 +00:00
1 parent a83aec31ca
commit d68b1bbc68
1 file changed
+18
+18
View File
@@ -245,6 +245,10 @@ async function main() {
if (!assetEtag || assetEtag.length === 0) {
throw new Error("Smoke test failed: expected ETag on built asset response.");
}
const assetContentType = assetResponse.headers.get("content-type");
if (!assetContentType || assetContentType.length === 0) {
throw new Error("Smoke test failed: expected content-type on built asset response.");
}
const assetLastModified = assetResponse.headers.get("last-modified");
if (!assetLastModified || assetLastModified.length === 0) {
throw new Error("Smoke test failed: expected Last-Modified on built asset response.");
@@ -280,6 +284,13 @@ async function main() {
)}.`,
);
}
if (conditionalAsset.headers.get("content-type") !== assetContentType) {
throw new Error(
`Smoke test failed: expected conditional asset content-type ${assetContentType}, got ${String(
conditionalAsset.headers.get("content-type"),
)}.`,
);
}
if ((conditionalAsset.headers.get("cache-control") ?? "").toLowerCase() !== assetCacheControl) {
throw new Error("Smoke test failed: expected cache-control preserved on conditional asset response.");
}
@@ -605,6 +616,13 @@ async function main() {
)}.`,
);
}
if (conditionalHeadAsset.headers.get("content-type") !== assetContentType) {
throw new Error(
`Smoke test failed: expected conditional HEAD asset content-type ${assetContentType}, got ${String(
conditionalHeadAsset.headers.get("content-type"),
)}.`,
);
}
if ((conditionalHeadAsset.headers.get("cache-control") ?? "").toLowerCase() !== assetCacheControl) {
throw new Error(
"Smoke test failed: expected cache-control preserved on conditional HEAD asset response.",