From e2c79eecb2caf7a322e674983ba9318c69e0a8a6 Mon Sep 17 00:00:00 2001 From: Nikolay Lanets Date: Thu, 19 Apr 2018 16:09:21 +0300 Subject: [PATCH] Update index.js (#1473) Set XHR object timeout; --- packages/web3-providers-http/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web3-providers-http/src/index.js b/packages/web3-providers-http/src/index.js index 38b2c548f4e..074ad2f918a 100644 --- a/packages/web3-providers-http/src/index.js +++ b/packages/web3-providers-http/src/index.js @@ -40,6 +40,7 @@ HttpProvider.prototype._prepareRequest = function(){ request.open('POST', this.host, true); request.setRequestHeader('Content-Type','application/json'); + request.timeout = this.timeout && this.timeout !== 1 ? this.timeout : 0; if(this.headers) { this.headers.forEach(function(header) {