Merge pull request #2126 from natcl/master

http request node: warn user if msg.requestTimeout == 0
This commit is contained in:
Nick O'Leary
2019-05-17 10:47:37 +01:00
committed by GitHub
2 changed files with 25 additions and 2 deletions

View File

@@ -94,10 +94,10 @@ module.exports = function(RED) {
opts.maxRedirects = 21;
opts.jar = request.jar();
opts.proxy = null;
if (msg.requestTimeout) {
if (msg.requestTimeout !== undefined) {
if (isNaN(msg.requestTimeout)) {
node.warn(RED._("httpin.errors.timeout-isnan"));
} else if (msg.requestTimeout < 0) {
} else if (msg.requestTimeout < 1) {
node.warn(RED._("httpin.errors.timeout-isnegative"));
} else {
opts.timeout = msg.requestTimeout;