multer icon indicating copy to clipboard operation
multer copied to clipboard

Multer breaks res.send

Open TheSainEyereg opened this issue 2 years ago • 0 comments

When client provides bad Content-Length header or does not provide it at all, multer usually returns an error code 400, but in case when this header is missing, you can simply add a line to tell the user that he needs a content length header:

But when Content-Length has a bad value, and you try to send information about this problem back to the user using res.send (or res.json), it doesn't send anything, only the HTTP 400 code:

Even when you use next(), res.send or res.json still doesn't work:


This thing really annoys me, even if it's not a bug, how can I fix it?

TheSainEyereg avatar Dec 31 '21 00:12 TheSainEyereg