up body limit

This commit is contained in:
Your Name 2026-08-26 18:53:14 -04:00
parent 3e6935d4a0
commit 7ea688a86c

View file

@ -62,8 +62,14 @@ function logError(structureId, routeId, e) {
model.createLog(structureId, routeId, formatError(e), true);
}
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
// body-parser defaults to a 100kb limit, which is far too small for what
// structures actually post: an emulator save state, a canvas data URL, a couple
// of images. It fails as an opaque HTML 413 from the middleware, before any
// handler runs, so the structure cannot even report it usefully. Files still go
// through express-fileupload below; this is only the JSON/form path.
const BODY_LIMIT = "25mb";
app.use(bodyParser.urlencoded({ extended: true, limit: BODY_LIMIT }));
app.use(bodyParser.json({ limit: BODY_LIMIT }));
app.use(express.static("public"));
app.use(fileUpload());