File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Original file line number Diff line number Diff line change @@ -27,18 +27,22 @@ describe("pagination", () => {
27
27
const startTime = performance . now ( ) ;
28
28
try {
29
29
for await ( const normalizedResponse of octokit . paginate . iterator (
30
- "GET /repos/{owner}/{repo}/issues" , { owner : "DayShift" , repo : "ReDos" , per_page : 100 }
31
- ) ) { }
30
+ "GET /repos/{owner}/{repo}/issues" ,
31
+ { owner : "DayShift" , repo : "ReDos" , per_page : 100 } ,
32
+ ) ) {
33
+ }
32
34
} catch ( error ) {
33
35
// pass
34
36
}
35
37
const endTime = performance . now ( ) ;
36
38
const elapsedTime = endTime - startTime ;
37
- const reDosThreshold = 2000 ;
38
-
39
+ const reDosThreshold = 2000 ;
40
+
39
41
expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
40
42
if ( elapsedTime > reDosThreshold ) {
41
- console . warn ( `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ) ;
43
+ console . warn (
44
+ `🚨 Potential ReDoS Attack! getDuration method took ${ elapsedTime . toFixed ( 2 ) } ms, exceeding threshold of ${ reDosThreshold } ms.` ,
45
+ ) ;
42
46
}
43
47
} ) ;
44
48
You can’t perform that action at this time.
0 commit comments