mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix overriding method in HTTP Req node
This commit is contained in:
parent
b7e3e2d739
commit
09f162d933
@ -106,14 +106,14 @@ RED.nodes.registerType("http response",HTTPOut);
|
||||
function HTTPRequest(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var nodeUrl = n.url;
|
||||
var method = n.method || "GET";
|
||||
var nodeMethod = n.method || "GET";
|
||||
var node = this;
|
||||
this.on("input",function(msg) {
|
||||
|
||||
var url = msg.url||nodeUrl;
|
||||
|
||||
var method = (msg.method||nodeMethod).toUpperCase();
|
||||
var opts = urllib.parse(url);
|
||||
opts.method = (msg.method||method).toUpperCase();
|
||||
opts.method = method;
|
||||
if (msg.headers) {
|
||||
opts.headers = msg.headers;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user