Files
openclaw/src/proxy-capture/proxy-server.test.ts
Tak Hoffman 958c34e82c feat(qa-lab): Add proxy capture stack and QA Lab inspector (#64895)
* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
2026-04-11 12:34:57 -05:00

23 lines
653 B
TypeScript

import { describe, expect, it } from "vitest";
import { parseConnectTarget } from "./proxy-server.js";
describe("parseConnectTarget", () => {
it("parses bracketed IPv6 CONNECT targets safely", () => {
expect(parseConnectTarget("[::1]:8443")).toEqual({
hostname: "::1",
port: 8443,
});
});
it("parses unbracketed host:port CONNECT targets", () => {
expect(parseConnectTarget("api.openai.com:443")).toEqual({
hostname: "api.openai.com",
port: 443,
});
});
it("rejects invalid CONNECT ports", () => {
expect(() => parseConnectTarget("[::1]:99999")).toThrow("Invalid CONNECT target port");
});
});