We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86a823b commit 36f04afCopy full SHA for 36f04af
1 file changed
src/load-balancer/http-load-balancer.ts
@@ -10,6 +10,7 @@ import type {
10
} from '../interfaces/load-balancer'
11
import type { Logger } from '../interfaces/logger'
12
import { defaultLogger } from '../logger/pino-logger'
13
+import * as crypto from 'crypto';
14
15
/**
16
* Internal target with additional tracking data
@@ -421,7 +422,9 @@ export class HttpLoadBalancer implements LoadBalancer {
421
422
}
423
424
private generateSessionId(): string {
- return Math.random().toString(36).substring(2) + Date.now().toString(36)
425
+ const randomPart = crypto.randomBytes(16).toString('hex'); // 16 bytes = 32 hex characters
426
+ const timestampPart = Date.now().toString(36);
427
+ return randomPart + timestampPart;
428
429
430
private getClientId(request: Request): string {
0 commit comments