fix: harden workflow console rpc boundary

This commit is contained in:
lda
2026-07-02 14:28:25 +07:00 Verified
parent f112f73a0e
commit bcf31583af
20 changed files with 890 additions and 465 deletions
+3 -14
View File
@@ -23,19 +23,8 @@ export function addStaticRoutes(
): void {
const { consoleRoot } = options;
app.all("/api/*", (c) => c.json({ error: "not found" }, 404));
app.use("/assets/*", serveStatic({ root: consoleRoot }));
app.get("*", (c) => {
if (c.req.path.startsWith("/api/")) {
return c.json({ error: "not found" }, 404);
}
return serveStatic({ root: consoleRoot, path: "index.html" })(c);
});
app.all("*", (c) => {
if (c.req.path.startsWith("/api/")) {
return c.json({ error: "not found" }, 404);
}
return c.json({ error: "not found" }, 404);
});
app.get("*", serveStatic({ root: consoleRoot, path: "index.html" }));
app.all("*", (c) => c.json({ error: "not found" }, 404));
}