refactor: dedupe agent lowercase helpers

This commit is contained in:
Peter Steinberger
2026-04-07 17:07:35 +01:00
parent 9e61209780
commit d56fe040b4
30 changed files with 87 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
import path from "node:path";
import { resolveStateDir } from "../config/paths.js";
import { loadJsonFile, saveJsonFile } from "../infra/json-file.js";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { buildCopilotIdeHeaders } from "./copilot-dynamic-headers.js";
import { resolveProviderEndpoint } from "./provider-attribution.js";
@@ -69,7 +70,7 @@ function resolveCopilotProxyHost(proxyEp: string): string | null {
if (url.protocol !== "http:" && url.protocol !== "https:") {
return null;
}
return url.hostname.toLowerCase();
return normalizeLowercaseStringOrEmpty(url.hostname);
} catch {
return null;
}