up body limit
This commit is contained in:
parent
3e6935d4a0
commit
7ea688a86c
1 changed files with 8 additions and 2 deletions
10
index.js
10
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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue