@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
ts 23 lines 772 Bytes
Raw
1 import { describe, expect, it } from "vite-plus/test";
2
3 import { isSecureRelayUrl, normalizeSecureRelayUrl } from "./relayUrl.ts";
4
5 describe("normalizeSecureRelayUrl", () => {
6 it("normalizes secure relay origins", () => {
7 expect(normalizeSecureRelayUrl(" https://relay.example.test/// ")).toBe(
8 "https://relay.example.test",
9 );
10 expect(normalizeSecureRelayUrl("https://relay.example.test:8443/")).toBe(
11 "https://relay.example.test:8443",
12 );
13 });
14
15 it.each([
16 "http://relay.example.test",
17 "https://user:password@relay.example.test",
18 "https://relay.example.test/path",
19 ])("rejects unsafe relay URL %s", (value) => {
20 expect(normalizeSecureRelayUrl(value)).toBeNull();
21 expect(isSecureRelayUrl(value)).toBe(false);
22 });
23 });