From d98c5a9e39c312424fa2586d1fe846f2999d49f5 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 28 Jul 2021 21:51:50 +0000
Subject: [PATCH] Set explicit 5s connect timeout in proxy script

---
 common.js |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/common.js b/common.js
index 9551468..4c7b840 100644
--- a/common.js
+++ b/common.js
@@ -45,7 +45,9 @@
 Deferred.all = function(iterable) {
 	return new Deferred(
 		Promise.all(
-			iterable.map(x => x.promise)
+			iterable.map(function(x) {
+				return x.promise;
+			})
 		)
 	);
 };
@@ -57,6 +59,7 @@
 		var self = this;
 		var request = new XMLHttpRequest();
 		var promise = new Promise(function(resolve, reject) {
+			request.open('GET', url, true);
 			request.timeout = self.timeout;
 			request.onreadystatechange = function() {
 				if(this.readyState == 4) {
@@ -71,7 +74,6 @@
 					}
 				}
 			};
-			request.open('GET', url, true);
 			request.send();
 		});
 		return new Deferred(promise, request);

--
Gitblit v1.9.1