mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 14:10:44 +00:00
test: tighten external content marker assertion
This commit is contained in:
@@ -496,8 +496,10 @@ describe("external-content security", () => {
|
||||
|
||||
// The malicious tags are contained within the safe boundaries
|
||||
const startMatch = result.match(/<<<EXTERNAL_UNTRUSTED_CONTENT id="[a-f0-9]{16}">>>/);
|
||||
expect(startMatch).not.toBeNull();
|
||||
expect(result.indexOf(startMatch![0])).toBeLessThan(result.indexOf("</user>"));
|
||||
if (startMatch === null) {
|
||||
throw new Error("Expected external content start marker");
|
||||
}
|
||||
expect(result.indexOf(startMatch[0])).toBeLessThan(result.indexOf("</user>"));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user