fix: normalize wildcard gateway URLs for Codex
This commit is contained in:
@@ -8,6 +8,8 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
|
||||
import { getGatewayBaseUrl } from "./admin-lib.mjs";
|
||||
|
||||
const scriptsRoot = import.meta.dirname;
|
||||
const launchScript = path.join(scriptsRoot, "launch-ui.sh");
|
||||
const restoreScript = path.join(scriptsRoot, "restore-codex-config.sh");
|
||||
@@ -122,6 +124,10 @@ async function run() {
|
||||
const gatewayPort = await getFreePort();
|
||||
const gatewayBaseUrl = `http://127.0.0.1:${gatewayPort}`;
|
||||
const upstreamBaseUrl = `http://127.0.0.1:${upstreamPort}`;
|
||||
assert(
|
||||
getGatewayBaseUrl("0.0.0.0", gatewayPort) === gatewayBaseUrl,
|
||||
"Wildcard listener must normalize to loopback for local gateway URLs",
|
||||
);
|
||||
|
||||
await mkdir(codexDir, { recursive: true });
|
||||
await writeFile(
|
||||
|
||||
Reference in New Issue
Block a user