fix: 🐛 Fixes base64 iterations

This commit is contained in:
Viktor Sarström 2021-09-10 14:49:39 +02:00
parent 5017295206
commit 52d7341e2b
2 changed files with 9 additions and 3 deletions

View File

@ -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",

View File

@ -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<EtjanstChild[]> {
public async async async getChildren(): Promise<EtjanstChild[]> {
if (this.isFake) return fakeResponse(fake.children())
// const cdnUrl = await this.retrieveCdnUrl()