fix: 收窄上下文摘要脱敏误判

This commit is contained in:
湛兮
2026-06-12 03:04:53 +08:00
parent 2845e7cfd5
commit 36c22eb00d
+7 -1
View File
@@ -47,5 +47,11 @@ function redactValue(value: unknown): unknown {
}
function looksLikeSecret(value: string): boolean {
return value.length >= 24 && /^[A-Za-z0-9_./+=:-]+$/.test(value);
const trimmed = value.trim();
if (/[\s=;:,]/.test(trimmed)) {
return false;
}
return trimmed.length >= 32 && /^[A-Za-z0-9_./+:-]+$/.test(trimmed);
}