@@ -75,11 +75,13 @@ describe("endpoint.parse()", () => {
75
75
}
76
76
const endTime = performance . now ( ) ;
77
77
const elapsedTime = endTime - startTime ;
78
- const reDosThreshold = 2000 ;
78
+ const reDosThreshold = 2000 ;
79
79
80
80
expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
81
81
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
+ ) ;
83
85
}
84
86
} ) ;
85
87
@@ -105,11 +107,13 @@ describe("endpoint.parse()", () => {
105
107
}
106
108
const endTime = performance . now ( ) ;
107
109
const elapsedTime = endTime - startTime ;
108
- const reDosThreshold = 2000 ;
110
+ const reDosThreshold = 2000 ;
109
111
110
112
expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
111
113
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
+ ) ;
113
117
}
114
118
} ) ;
115
119
@@ -118,7 +122,7 @@ describe("endpoint.parse()", () => {
118
122
try {
119
123
endpoint . parse ( {
120
124
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
122
126
headers : {
123
127
accept : "application/vnd.github.v3+json" ,
124
128
"content-type" : "text/plain" ,
@@ -135,11 +139,13 @@ describe("endpoint.parse()", () => {
135
139
}
136
140
const endTime = performance . now ( ) ;
137
141
const elapsedTime = endTime - startTime ;
138
- const reDosThreshold = 2000 ;
142
+ const reDosThreshold = 2000 ;
139
143
140
144
expect ( elapsedTime ) . toBeLessThanOrEqual ( reDosThreshold ) ;
141
145
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
+ ) ;
143
149
}
144
150
} ) ;
145
151
} ) ;
0 commit comments