Skip to content

Commit 81f4e3b

Browse files
authored
Fix a couple path traversal test cases for getFileExtension. (#2620)
1 parent f5cd004 commit 81f4e3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/gui/src/util/getFileExtension.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ describe('getFileExtension', () => {
4747
expect(getFileExtension('https://example.com/../secret.txt')).toBe('txt');
4848
expect(getFileExtension('https://example.com/folder/../file.pdf')).toBe('pdf');
4949
expect(getFileExtension('https://example.com/./file.jpg')).toBe('jpg');
50-
expect(getFileExtension('https://example.com/test\secret.txt')).toBe('txt');
51-
expect(getFileExtension('https://example.com/test\..\secret.txt')).toBe('txt');
50+
expect(getFileExtension('https://example.com/test\\secret.txt')).toBe('txt');
51+
expect(getFileExtension('https://example.com/test\\..\\secret.txt')).toBe('txt');
5252
expect(getFileExtension('https://example.com/test/secret.t.xt')).toBe('xt');
5353
expect(getFileExtension('https://example.com/test/secret.t./xt')).toBeUndefined();
5454
expect(getFileExtension('https://example.com/test/secret.t/./xt')).toBeUndefined();

0 commit comments

Comments
 (0)