Skip to content

Commit 52fe372

Browse files
committed
test(auth): fail closed on unexpected Codex paths
1 parent ffd4eca commit 52fe372

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/claude-messages-endpoint.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,10 @@ test("native openai-responses route carries prompt_cache_key + synthesized sessi
657657
globalThis.fetch = ((input: RequestInfo | URL, init?: RequestInit) => {
658658
const requestUrl = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
659659
const url = new URL(requestUrl);
660-
if (url.origin === "https://chatgpt.com" && url.pathname === "/backend-api/codex/responses") {
660+
if (url.origin === "https://chatgpt.com") {
661+
if (url.pathname !== "/backend-api/codex/responses") {
662+
throw new Error(`unexpected canonical Codex path ${url.pathname}`);
663+
}
661664
return originalFetch(new URL("/responses", upstream.url), init);
662665
}
663666
return originalFetch(input, init);

0 commit comments

Comments
 (0)