@@ -664,7 +664,7 @@ describe('WebSocket', () => {
664
664
it ( "emits an 'error' event if an error occurs (2/2)" , function ( done ) {
665
665
if ( ! fs . openAsBlob ) return this . skip ( ) ;
666
666
667
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
667
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
668
668
const file = path . join ( os . tmpdir ( ) , `ws-${ randomString } .txt` ) ;
669
669
670
670
fs . writeFileSync ( file , 'x' . repeat ( 64 ) ) ;
@@ -704,7 +704,7 @@ describe('WebSocket', () => {
704
704
it ( "emits the 'error' event only once (1/2)" , function ( done ) {
705
705
if ( ! fs . openAsBlob ) return this . skip ( ) ;
706
706
707
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
707
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
708
708
const file = path . join ( os . tmpdir ( ) , `ws-${ randomString } .txt` ) ;
709
709
710
710
fs . writeFileSync ( file , 'x' . repeat ( 64 ) ) ;
@@ -760,7 +760,7 @@ describe('WebSocket', () => {
760
760
it ( "emits the 'error' event only once (2/2)" , function ( done ) {
761
761
if ( ! fs . openAsBlob ) return this . skip ( ) ;
762
762
763
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
763
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
764
764
const file = path . join ( os . tmpdir ( ) , `ws-${ randomString } .txt` ) ;
765
765
766
766
fs . writeFileSync ( file , 'x' . repeat ( 64 ) ) ;
@@ -812,7 +812,7 @@ describe('WebSocket', () => {
812
812
it ( "does not emit 'error' after 'close'" , function ( done ) {
813
813
if ( ! fs . openAsBlob ) return this . skip ( ) ;
814
814
815
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
815
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
816
816
const file = path . join ( os . tmpdir ( ) , `ws-${ randomString } .bin` ) ;
817
817
818
818
fs . writeFileSync ( file , crypto . randomBytes ( 1024 * 1024 ) ) ;
@@ -1866,7 +1866,7 @@ describe('WebSocket', () => {
1866
1866
it ( 'drops the Authorization, Cookie and Host headers (2/4)' , ( done ) => {
1867
1867
// Test the `ws:` to `ws+unix:` case.
1868
1868
1869
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
1869
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
1870
1870
const ipcPath =
1871
1871
process . platform === 'win32'
1872
1872
? `\\\\.\\pipe\\ws-pipe-${ randomString } `
@@ -1926,8 +1926,8 @@ describe('WebSocket', () => {
1926
1926
it ( 'drops the Authorization, Cookie and Host headers (3/4)' , ( done ) => {
1927
1927
// Test the `ws+unix:` to `ws+unix:` case.
1928
1928
1929
- const randomString1 = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
1930
- const randomString2 = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
1929
+ const randomString1 = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
1930
+ const randomString2 = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
1931
1931
let redirectingServerIpcPath ;
1932
1932
let redirectedServerIpcPath ;
1933
1933
@@ -2025,7 +2025,7 @@ describe('WebSocket', () => {
2025
2025
ws . close ( ) ;
2026
2026
} ) ;
2027
2027
2028
- const randomString = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
2028
+ const randomString = crypto . randomBytes ( 4 ) . toString ( 'hex' ) ;
2029
2029
const ipcPath =
2030
2030
process . platform === 'win32'
2031
2031
? `\\\\.\\pipe\\ws-pipe-${ randomString } `
0 commit comments