Skip to content

Express API server not respecting PISTON_MAX_FILE_SIZE #706

Open
@funsim

Description

@funsim

The Express API uses the default body_parser settings, which results in a 100kb body size limit. To fix, this, we would need to read the PISTON_MAX_FILE_SIZE value and use it like the example below:

--- index.js	2025-03-18 14:10:16
+++ index.js	2025-03-18 14:10:14
@@ -64,8 +64,8 @@
     logger.debug('Constructing Express App');
     logger.debug('Registering middleware');

-    app.use(body_parser.urlencoded({ extended: true }));
-    app.use(body_parser.json());
+    app.use(body_parser.urlencoded({ extended: true, limit: '10mb' }));
+    app.use(body_parser.json({ limit: '10mb' }));

     app.use((err, req, res, next) => {
         return res.status(400).send({

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions