From b6be924a8e0cc8b1a65e75ce8c3be58b862638c0 Mon Sep 17 00:00:00 2001 From: Henrik Halvorsen Hortemo Date: Thu, 6 Jul 2017 11:35:04 -0400 Subject: [PATCH] Added timeout to HTTPS request --- lib/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/client.js b/lib/client.js index f5b5ebc..275c6db 100644 --- a/lib/client.js +++ b/lib/client.js @@ -111,6 +111,10 @@ client.prototype.request = function(method, path, params, callback){ }); }); + req.setTimeout(30000, function(){ + req.abort(); + }); + // This should only occur for errors such as a socket hang up prior to any // data being received, or SSL-related issues. req.on("error", function(err){