Skip to content

Commit eb227e6

Browse files
committed
test(cli): count script elements case-insensitively in the escape guard
Splitting on the exact string `<script>` would let `<script src=…>` slip past the assertion.
1 parent 2108530 commit eb227e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/pythinker-code/test/cli/web/remote-control.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('Remote Control HTTP forwarding', () => {
146146
).toString();
147147
expect(html).not.toContain('</script><script>alert(1)');
148148
expect(html).toContain('\\u003c/script\\u003e');
149-
expect(html.split('<script>')).toHaveLength(2);
149+
expect(html.match(/<script\b/gi)).toHaveLength(1);
150150
});
151151

152152
it('rejects absolute-form and malformed request targets', () => {

0 commit comments

Comments
 (0)