Skip to content

Commit e127178

Browse files
Chessaxmathiasbynens
authored andcommitted
Adding global flag to regex to strip all script tags from preparation code output (#422)
1 parent f2b9206 commit e127178

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/web/test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exports.register = function (server, options, next) {
2323
var stripped = false;
2424

2525
if (hasPrep) {
26-
const reScripts = new RegExp(regex.script, 'i');
26+
const reScripts = new RegExp(regex.script, 'gi');
2727
stripped = page.initHTML.replace(reScripts, '');
2828

2929
var swappedScripts = [];
@@ -42,7 +42,7 @@ exports.register = function (server, options, next) {
4242
}
4343
),
4444
true
45-
).value.replace(/@jsPerfTagToken/, () => swappedScripts.pop());
45+
).value.replace(/@jsPerfTagToken/g, () => swappedScripts.pop());
4646
}
4747

4848
// update hits once per page per session

0 commit comments

Comments
 (0)