expressjs / body-parser

Node.js body parsing middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Truncated parameter data that is over 1mb in size.

CPunch opened this issue · comments

commented

Issue is simple, if I post to express with a parameter > 1mb in length (1048576 characters in a string), the data is truncated and cut off at the 1048576th character. I've tried setting the limit, the parameterlimit, and still the string is truncated to 1048576 characters.

app.use(bodyParser.urlencoded({limit: 10000000000, extended: true})); app.use(bodyParser.json({limit: 10000000000, extended: true, parameterlimit: 999999}));

Am I missing something? I only set it to those outrageous values to prove that they couldn't be it.

Hey @CPunch, can you post some sample code to reproduce the issue (both server and client)? Also, is your request going directly from the client to express, or are there other layers in between (like a reverse proxy)? Also, what node version and body-parser version so if we need to test we make sure we have all the correct context.

I haven't seen this issue, and have for sure sent bodies larger than that, so hopefully we can help figure it out.

commented

I wrote a test project to recreate my issue, however it works fine in that project. The project I see the truncating in is huge and closed source unfortunately. Whatever is causing the issue isn't BodyParser so I'll go ahead and close this issue. Sorry about that!