refactor: dedupe lowercase helper readers

This commit is contained in:
Peter Steinberger
2026-04-07 14:48:12 +01:00
parent eba04199f8
commit 948d139399
13 changed files with 82 additions and 33 deletions

View File

@@ -10,6 +10,7 @@ import { resolveStateDir, type OpenClawConfig } from "../config/config.js";
import { coerceSecretRef } from "../config/types.secrets.js";
import { resolveSecretInputRef, type SecretRef } from "../config/types.secrets.js";
import { formatErrorMessage } from "../infra/errors.js";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { resolveConfigDir, resolveUserPath } from "../utils.js";
import { runTasksWithConcurrency } from "../utils/run-with-concurrency.js";
import { iterateAuthProfileCredentials } from "./auth-profiles-scan.js";
@@ -127,7 +128,7 @@ const SENSITIVE_MODEL_PROVIDER_HEADER_NAME_FRAGMENTS = [
];
function isLikelySensitiveModelProviderHeaderName(value: string): boolean {
const normalized = value.trim().toLowerCase();
const normalized = normalizeLowercaseStringOrEmpty(value);
if (!normalized) {
return false;
}