Merge pull request #5228 from debadutta98/fix-http-in-node-issue

Fix: multipart form data upload issue
pull/5232/head
Nick O'Leary 2025-07-29 13:21:29 +01:00 committed by GitHub
commit 0df3bafb9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -30,8 +30,8 @@ module.exports = function(RED) {
var rawDataRoutes = new Set();
function rawBodyParser(req, res, next) {
if (req.skipRawBodyParser) { next(); } // don't parse this if told to skip
if (req._body) { return next(); }
if (req.skipRawBodyParser || req._body || req.readableEnded) return next();
req.body = "";
req._body = true;
@ -323,7 +323,9 @@ module.exports = function(RED) {
if (this.upload) {
var mp = multer({ storage: multer.memoryStorage() }).any();
multipartParser = function(req,res,next) {
if(req.readableEnded || req._body) return next();
mp(req,res,function(err) {
req._body = true;
next(err);
})
};