This commit is contained in:
eromano
2023-08-04 16:49:15 +02:00
parent 2e34973778
commit 4a3a744a2d
11 changed files with 16 additions and 31 deletions

View File

@@ -289,7 +289,8 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
}
private createCSRFToken(a?: any): string {
return a ? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16) : ([1e16] + (1e16).toString()).replace(/[01]/g, this.createCSRFToken);
const randomValue = window.crypto.getRandomValues(new Uint32Array(1))[0];
return a ? (a ^ ((randomValue * 16) >> (a / 4))).toString(16) : ([1e16] + (1e16).toString()).replace(/[01]/g, this.createCSRFToken);
}
private static getResponseType(options: RequestOptions): 'blob' | 'json' | 'text' {