Skip to content

Commit

Permalink
Add infinite loop test
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Nov 20, 2024
1 parent a0c2dc0 commit f8f9263
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions library/vulnerabilities/ssrf/getRedirectOrigin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,22 @@ t.test(
);
}
);

t.test("it does not result in an infinite loop", async (t) => {
t.equal(
getRedirectOrigin(
[
{
source: new URL("https://example.com"),
destination: new URL("https://example.com/2"),
},
{
source: new URL("https://example.com/2"),
destination: new URL("https://example.com"),
},
],
new URL("https://example.com")
),
undefined
);
});

0 comments on commit f8f9263

Please sign in to comment.