mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow http to accept delete properly, and put, options etc.
This commit is contained in:
parent
07fd5a5f5f
commit
cf25b2866e
@ -60,7 +60,7 @@ module.exports = function(RED) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.callback = function(req,res) {
|
this.callback = function(req,res) {
|
||||||
if (node.method == "post") {
|
if (node.method.match(/(^post$|^delete$|^put$|^options$)/)) {
|
||||||
node.send({req:req,res:res,payload:req.body});
|
node.send({req:req,res:res,payload:req.body});
|
||||||
} else if (node.method == "get") {
|
} else if (node.method == "get") {
|
||||||
node.send({req:req,res:res,payload:req.query});
|
node.send({req:req,res:res,payload:req.query});
|
||||||
@ -103,7 +103,7 @@ module.exports = function(RED) {
|
|||||||
} else if (this.method == "put") {
|
} else if (this.method == "put") {
|
||||||
RED.httpNode.put(this.url,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
RED.httpNode.put(this.url,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
||||||
} else if (this.method == "delete") {
|
} else if (this.method == "delete") {
|
||||||
RED.httpNode.delete(this.url,corsHandler,metricsHandler,this.callback,this.errorHandler);
|
RED.httpNode.delete(this.url,corsHandler,metricsHandler,jsonParser,urlencParser,rawBodyParser,this.callback,this.errorHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.on("close",function() {
|
this.on("close",function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user