Assert static POST rejection in smoke test

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:08:38 +00:00
1 parent 94b265759b
commit c217a55d3d
1 file changed
+14
+14
View File
@@ -175,6 +175,20 @@ async function main() {
`Smoke test failed: expected missing asset status 404, received ${missingAsset.status}.`,
);
}
const postPage = await fetch(parsedAppUrl, {
method: "POST",
body: "noop",
});
if (postPage.status !== 405) {
throw new Error(`Smoke test failed: expected POST status 405, received ${postPage.status}.`);
}
if ((postPage.headers.get("allow") ?? "").toLowerCase() !== "get, head") {
throw new Error(
`Smoke test failed: expected Allow header 'GET, HEAD', got ${String(
postPage.headers.get("allow"),
)}.`,
);
}
const headPage = await fetch(parsedAppUrl, { method: "HEAD" });
if (headPage.status !== 200) {
throw new Error(