Skip to content

Commit 7d1fade

Browse files
authored
fix: mitigate ReDos issues & linting issues (#659)
Releases bb6c4f9
1 parent bb6c4f9 commit 7d1fade

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/paginate.test.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@ describe("pagination", () => {
2727
const startTime = performance.now();
2828
try {
2929
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+
}
3234
} catch (error) {
3335
// pass
3436
}
3537
const endTime = performance.now();
3638
const elapsedTime = endTime - startTime;
37-
const reDosThreshold = 2000;
38-
39+
const reDosThreshold = 2000;
40+
3941
expect(elapsedTime).toBeLessThanOrEqual(reDosThreshold);
4042
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+
);
4246
}
4347
});
4448

0 commit comments

Comments
 (0)