diff --git a/packages/node_modules/@node-red/nodes/core/network/21-httpin.js b/packages/node_modules/@node-red/nodes/core/network/21-httpin.js index 060d479b6..4cbf03f39 100644 --- a/packages/node_modules/@node-red/nodes/core/network/21-httpin.js +++ b/packages/node_modules/@node-red/nodes/core/network/21-httpin.js @@ -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); }) };