From 52d7341e2b85ddddd9df2070cffc3322a3c58476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sarstr=C3=B6m?= Date: Fri, 10 Sep 2021 14:49:39 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fixes=20base64=20iteratio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 3 ++- lib/api.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 147e91ee..ed794808 100644 --- a/config.json +++ b/config.json @@ -14,7 +14,8 @@ "x-xsrf-token": "SfONpuvKXD1XHML3Kelvm3easB6Xn3xtbVPG52jdpc3Q7sRxJv7_6wfjo1qS3NOQWkfCvfPkJpJg0QIBmo358o7FdQY2aWvUOxA9MU2Fl0E1", "y-xsrf-token11": "FyXUbtZUE2iT09J7FOLTpfZ_onjbj3WEIO6jOY9B1KaZzMrAs4WS03AuWbQhmKyCEX2inTPVDzyPc58tN2EM4L1vYD6aH_zhlc7gVo9jaPdLKQc4qnE6ue184cSamKE0", "topology-key": "mettle ohmmeter alible camper stultify sap sunbeam pussy tithable colorant scleroma trireme niggard heather wacke abide rustic armature selfheal gyrus|", - "topology-short-key": "nancyzymosiszygosis" + "topology-short-key": "nancyzymosiszygosis", + "topology-base64-iterations": "8" }, "referrer": "https://etjanst.stockholm.se/", "referrerPolicy": "strict-origin-when-cross-origin", diff --git a/lib/api.ts b/lib/api.ts index e09ed706..978bd965 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -321,7 +321,12 @@ export class Api extends EventEmitter { let topo = `${config.headers['topology-key']}${currentTime}` const secretNumberString = `${config.headers['topology-short-key']}` - const numberOfBase64Iterations = 9 + + let numberOfBase64Iterations = 0; + + if(config.headers['topology-base64-iterations']) { + numberOfBase64Iterations = parseInt(config.headers['topology-base64-iterations']); + } for (let i = 0; i < numberOfBase64Iterations; i += 1) { topo = base64.encode(topo) @@ -336,7 +341,7 @@ export class Api extends EventEmitter { return finalTopology } - public async getChildren(): Promise { + public async async async getChildren(): Promise { if (this.isFake) return fakeResponse(fake.children()) // const cdnUrl = await this.retrieveCdnUrl()