Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] EXPRESS_JSON_LIMIT env variable does not work. #153

Open
ValiDrv opened this issue Jan 9, 2023 · 0 comments
Open

[BUG] EXPRESS_JSON_LIMIT env variable does not work. #153

ValiDrv opened this issue Jan 9, 2023 · 0 comments

Comments

@ValiDrv
Copy link

ValiDrv commented Jan 9, 2023

If you POST over the default 100kb from process.env.EXPRESS_JSON_LIMIT, you get the 413 Payload Too Large error, so basically that variable is useless.

This can be fixed in index.js at line ~32

const json_limit = process.env.EXPRESS_JSON_LIMIT || '100kb';
app.use(
  express.json({
    limit: json_limit,                                       
  }),                                                             
);                       
const bodyParser = require('body-parser');
app.use(bodyParser.json({limit: json_limit}));
app.use(bodyParser.urlencoded({limit: json_limit, extended: true}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant