@@ -9,7 +9,6 @@ import * as _ from "lodash";
99import { EventEmitter } from 'events' ;
1010import portfinder = require( "portfinder" ) ;
1111import connect = require( "connect" ) ;
12- import { v4 as uuid } from "uuid" ;
1312import cors = require( "cors" ) ;
1413import now = require( "performance-now" ) ;
1514import WebSocket = require( "ws" ) ;
@@ -687,7 +686,7 @@ export class MockttpServer extends AbstractMockttp implements Mockttp {
687686 } ) ;
688687 }
689688
690- const id = uuid ( ) ;
689+ const id = crypto . randomUUID ( ) ;
691690
692691 const tags : string [ ] = getSocketMetadataTags ( socketMetadata ) ;
693692
@@ -1050,7 +1049,7 @@ ${await this.suggestRule(request)}`
10501049 const isHeaderOverflow = errorCode === "HPE_HEADER_OVERFLOW" ;
10511050
10521051 const commonParams = {
1053- id : uuid ( ) ,
1052+ id : crypto . randomUUID ( ) ,
10541053 tags : [
10551054 `client-error:${ error . code || 'UNKNOWN' } ` ,
10561055 ...getSocketMetadataTags ( socket [ SocketMetadata ] )
@@ -1142,7 +1141,7 @@ ${await this.suggestRule(request)}`
11421141 this . announceClientErrorAsync ( session . initialSocket , {
11431142 errorCode : error . code ,
11441143 request : {
1145- id : uuid ( ) ,
1144+ id : crypto . randomUUID ( ) ,
11461145 tags : [
11471146 `client-error:${ error . code || 'UNKNOWN' } ` ,
11481147 ...( isBadPreface ? [ 'client-error:bad-preface' ] : [ ] ) ,
@@ -1192,7 +1191,7 @@ ${await this.suggestRule(request)}`
11921191 ? buildRawSocketEventData ( socket )
11931192 : buildTlsSocketEventData ( socket as tls . TLSSocket ) ,
11941193 {
1195- id : uuid ( ) ,
1194+ id : crypto . randomUUID ( ) ,
11961195 hostname : hostname , // Deprecated, but kept here for backward compat
11971196 destination : { hostname, port : targetPort }
11981197 }
0 commit comments