mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:00:43 +00:00
* 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
23 lines
653 B
TypeScript
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");
|
|
});
|
|
});
|