File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const tracer = setupTracing('example-redis-server');
7
7
import * as express from 'express' ;
8
8
import axios from 'axios' ;
9
9
import * as tracerHandlers from './express-tracer-handlers' ;
10
+ import { randomBytes } from 'crypto' ;
10
11
const redisPromise = require ( './setup-redis' ) . redis ;
11
12
12
13
// Setup express
@@ -20,12 +21,7 @@ async function setupRoutes() {
20
21
const redis = await redisPromise ;
21
22
22
23
app . get ( '/run_test' , async ( req : express . Request , res : express . Response ) => {
23
- const uuid = Math . random ( )
24
- . toString ( 36 )
25
- . substring ( 2 , 15 )
26
- + Math . random ( )
27
- . toString ( 36 )
28
- . substring ( 2 , 15 ) ;
24
+ const uuid = randomBytes ( 16 ) . toString ( 'hex' ) ;
29
25
await axios . get ( `http://localhost:${ PORT } /set?args=uuid,${ uuid } ` ) ;
30
26
const body = await axios . get ( `http://localhost:${ PORT } /get?args=uuid` ) ;
31
27
You can’t perform that action at this time.
0 commit comments