@@ -75,11 +75,13 @@ describe("endpoint.parse()", () => {
7575 }
7676 const endTime = performance . now ( ) ;
7777 const elapsedTime = endTime - startTime ;
78- const reDosThreshold = 2000 ;
78+ const reDosThreshold = 2000 ;
7979
8080 expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
8181 if ( elapsedTime > reDosThreshold ) {
82- console . warn ( `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ) ;
82+ console . warn (
83+ `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ,
84+ ) ;
8385 }
8486 } ) ;
8587
@@ -105,11 +107,13 @@ describe("endpoint.parse()", () => {
105107 }
106108 const endTime = performance . now ( ) ;
107109 const elapsedTime = endTime - startTime ;
108- const reDosThreshold = 2000 ;
110+ const reDosThreshold = 2000 ;
109111
110112 expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
111113 if ( elapsedTime > reDosThreshold ) {
112- console . warn ( `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ) ;
114+ console . warn (
115+ `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ,
116+ ) ;
113117 }
114118 } ) ;
115119
@@ -118,7 +122,7 @@ describe("endpoint.parse()", () => {
118122 try {
119123 endpoint . parse ( {
120124 method : "POST" ,
121- url : "{" + "00" + "\u0000" . repeat ( 100000 ) + "a!a" + "}" , // Pass in the attack string
125+ url : "{" + "00" + "\u0000" . repeat ( 100000 ) + "a!a" + "}" , // Pass in the attack string
122126 headers : {
123127 accept : "application/vnd.github.v3+json" ,
124128 "content-type" : "text/plain" ,
@@ -135,11 +139,13 @@ describe("endpoint.parse()", () => {
135139 }
136140 const endTime = performance . now ( ) ;
137141 const elapsedTime = endTime - startTime ;
138- const reDosThreshold = 2000 ;
142+ const reDosThreshold = 2000 ;
139143
140144 expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
141145 if ( elapsedTime > reDosThreshold ) {
142- console . warn ( `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ) ;
146+ console . warn (
147+ `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ,
148+ ) ;
143149 }
144150 } ) ;
145151} ) ;
0 commit comments