From ca6b0fb74ba34454df2997e4f6ca5e58b9b8f190 Mon Sep 17 00:00:00 2001 From: Enom Date: Fri, 18 Sep 2020 12:05:54 -0400 Subject: [PATCH 1/2] Added timeout to token refresh function (fixes #3) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dc67038..35ab582 100644 --- a/src/index.js +++ b/src/index.js @@ -124,7 +124,7 @@ export default class Transport { } catch (e) { // console.log the error?? this._transport = null; - this._scheduleRefresh(0); + this._scheduleRefresh(MAX_JOB_WAIT_TIME); } } From 0fd7c42de28d33a36066865bb85fc1924a42f246 Mon Sep 17 00:00:00 2001 From: Enom Date: Fri, 18 Sep 2020 12:23:44 -0400 Subject: [PATCH 2/2] Actual fix for DDOS prevention --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 35ab582..880032a 100644 --- a/src/index.js +++ b/src/index.js @@ -124,7 +124,7 @@ export default class Transport { } catch (e) { // console.log the error?? this._transport = null; - this._scheduleRefresh(MAX_JOB_WAIT_TIME); + this._scheduleRefresh(Date.now() + MIN_REFRESH_TIMEOUT + MAX_JOB_WAIT_TIME); } }