mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Update 21-httprequest.js
Adding HTTP persistent definition and function
This commit is contained in:
parent
78bee3dc59
commit
4d60447242
@ -29,6 +29,7 @@ module.exports = function(RED) {
|
|||||||
var isTemplatedUrl = (nodeUrl||"").indexOf("{{") != -1;
|
var isTemplatedUrl = (nodeUrl||"").indexOf("{{") != -1;
|
||||||
var nodeMethod = n.method || "GET";
|
var nodeMethod = n.method || "GET";
|
||||||
var paytoqs = n.paytoqs;
|
var paytoqs = n.paytoqs;
|
||||||
|
var nodeHTTPPersistent = n["http-persistent"];
|
||||||
if (n.tls) {
|
if (n.tls) {
|
||||||
var tlsNode = RED.nodes.getNode(n.tls);
|
var tlsNode = RED.nodes.getNode(n.tls);
|
||||||
}
|
}
|
||||||
@ -94,6 +95,7 @@ module.exports = function(RED) {
|
|||||||
opts.maxRedirects = 21;
|
opts.maxRedirects = 21;
|
||||||
opts.jar = request.jar();
|
opts.jar = request.jar();
|
||||||
opts.proxy = null;
|
opts.proxy = null;
|
||||||
|
opts.forever = nodeHTTPPersistent;
|
||||||
if (msg.requestTimeout !== undefined) {
|
if (msg.requestTimeout !== undefined) {
|
||||||
if (isNaN(msg.requestTimeout)) {
|
if (isNaN(msg.requestTimeout)) {
|
||||||
node.warn(RED._("httpin.errors.timeout-isnan"));
|
node.warn(RED._("httpin.errors.timeout-isnan"));
|
||||||
|
Loading…
Reference in New Issue
Block a user