From 7ea688a86c67f190371a43185679f78d2e1e69a9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Aug 2026 18:53:14 -0400 Subject: [PATCH] up body limit --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index bedc496..6c2271e 100644 --- a/index.js +++ b/index.js @@ -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());