From a9b9f706fabfabd18e7f1097999dd3aaa2609ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Thu, 28 Feb 2019 18:47:18 +0000 Subject: [PATCH] Do not setTimeout if in pretend mode When on pretend mode, it is not clearing the setTimeouts. This change will try to avoid creating them if in pretend mode. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8a11b30..3e19516 100644 --- a/index.js +++ b/index.js @@ -132,8 +132,8 @@ exports.request = function (options, callback) { options['max-redirs'] = 3; } - //Add an additional setTimeout for max-time - if (options['max-time']) { + //Add an additional setTimeout for max-time (only if not in pretend mode) + if (options['max-time'] && options.pretend !== true) { timeout = setTimeout(function () { if (complete) return; stderr = 'timeout', stdout = null;