Skip to content

Commit a591f51

Browse files
authored
fix(replay): fix path separator substitution to replay all \ (#6932)
Fixes [CodeQL #81](https://github.com/getsentry/sentry-javascript/security/code-scanning/81). The `.replace()` originally here only replaced the first occurrence of double-backslashes. Using a regex with a global flag option ensures all of the `\\`'s are replaced with `/`.
1 parent 040ab0c commit a591f51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/replay/metrics/src/scenarios.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class JankTestScenario implements Scenario {
3939
public async run(_: playwright.Browser, page: playwright.Page): Promise<void> {
4040
let url = path.resolve(`./test-apps/jank/${this._indexFile}`);
4141
assert(fs.existsSync(url));
42-
url = `file:///${url.replace('\\', '/')}`;
42+
url = `file:///${url.replace(/\\/g, '/')}`;
4343
console.log('Navigating to ', url);
4444
await page.goto(url, { waitUntil: 'load', timeout: 60000 });
4545
await new Promise(resolve => setTimeout(resolve, 5000));

0 commit comments

Comments
 (0)