mirror of https://github.com/node-red/node-red.git
Merge pull request #5228 from debadutta98/fix-http-in-node-issue
Fix: multipart form data upload issuepull/5232/head
commit
0df3bafb9d
|
|
@ -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);
|
||||
})
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue