fix(browser): close scenario containment gaps

This commit is contained in:
morluto
2026-07-24 14:40:07 +00:00
parent 83b3368d8d
commit 1bd65f68bc
6 changed files with 206 additions and 78 deletions
+6 -1
View File
@@ -42,7 +42,12 @@ export class BrowserScenarioSecrets {
redact(value: string): string {
let output = value;
for (const [id, secret] of this.values)
const replacements = [...this.values].sort(
([leftId, left], [rightId, right]) =>
right.length - left.length ||
(leftId < rightId ? -1 : leftId > rightId ? 1 : 0),
);
for (const [id, secret] of replacements)
if (secret !== "")
output = output.replaceAll(secret, `${REDACTION_PREFIX}${id}]`);
return output;