mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:52:44 +00:00
test(bundler): tolerate whitespace in closing script tag
CodeQL's `js/bad-tag-filter` rule flagged `</script>` as too strict — `</script >` (with whitespace before `>`) is valid HTML and would slip past the matcher. Changed to `</script\s*>` for full defense-in-depth. The bundler always emits the canonical form, so no real-traffic miss — this is hardening the test's parse-loop, not fixing a downstream bug. Addresses CodeQL alert on #641.
This commit is contained in:
@@ -107,7 +107,7 @@ describe("bundleToSingleHtml", () => {
|
||||
// the separator, parse would fail with an unexpected-token error somewhere
|
||||
// around the chunk boundary.
|
||||
const { transformSync } = await import("esbuild");
|
||||
const re = /<script\b[^>]*>([\s\S]*?)<\/script>/gi;
|
||||
const re = /<script\b[^>]*>([\s\S]*?)<\/script\s*>/gi;
|
||||
let m: RegExpExecArray | null;
|
||||
while ((m = re.exec(bundled)) !== null) {
|
||||
const body = m[1];
|
||||
|
||||
Reference in New Issue
Block a user