fix: 收窄上下文摘要脱敏误判
This commit is contained in:
@@ -47,5 +47,11 @@ function redactValue(value: unknown): unknown {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function looksLikeSecret(value: string): boolean {
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user