Skip to content

Commit 322e343

Browse files
authored
test(shared): clarify explicit port coverage
Generated-By: PostHog Code Task-Id: 864ed341-adf3-40b7-b37c-baef45c4f05d
1 parent 9f5caf7 commit 322e343

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/shared/src/url.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ describe("isSafeExternalUrl", () => {
66
"https://github.com/PostHog/code/pull/42",
77
"http://example.com",
88
"https://example.com/path?q=1#frag",
9-
"https://example.com:443/path",
109
"HTTPS://EXAMPLE.COM",
1110
"mailto:hi@posthog.com",
1211
])("allows %s", (url) => {
1312
expect(isSafeExternalUrl(url)).toBe(true);
1413
});
1514

15+
it("allows HTTPS URLs with an explicit port", () => {
16+
expect(isSafeExternalUrl("https://example.com:8443/path")).toBe(true);
17+
});
18+
1619
it.each([
1720
"javascript:alert(1)",
1821
"file:///etc/passwd",

0 commit comments

Comments
 (0)