diff --git a/nodes/core/io/21-httpin.js b/nodes/core/io/21-httpin.js index 5cf4d8979..1148812ec 100644 --- a/nodes/core/io/21-httpin.js +++ b/nodes/core/io/21-httpin.js @@ -30,9 +30,9 @@ function rawBodyParser(req, res, next) { req.body = ""; req._body = true; getBody(req, { - limit: '1mb', - length: req.headers['content-length'], - encoding: 'utf8' + limit: '1mb', + length: req.headers['content-length'], + encoding: 'utf8' }, function (err, buf) { if (err) return next(err); req.body = buf; @@ -49,12 +49,12 @@ function HTTPIn(n) { this.method = n.method; var node = this; - + this.errorHandler = function(err,req,res,next) { node.warn(err); res.send(500); }; - + this.callback = function(req,res) { if (node.method == "post") { node.send({req:req,res:res,payload:req.body}); @@ -64,14 +64,14 @@ function HTTPIn(n) { node.send({req:req,res:res}); } } - + var corsHandler = function(req,res,next) { next(); } - + if (RED.settings.httpNodeCors) { corsHandler = cors(RED.settings.httpNodeCors); RED.httpNode.options(this.url,corsHandler); } - + if (this.method == "get") { RED.httpNode.get(this.url,corsHandler,this.callback,this.errorHandler); } else if (this.method == "post") { @@ -81,7 +81,7 @@ function HTTPIn(n) { } else if (this.method == "delete") { RED.httpNode.delete(this.url,corsHandler,this.callback,errorHandler); } - + this.on("close",function() { var routes = RED.httpNode.routes[this.method]; for (var i = 0; i