From 41d6dadb78781e936da063542beac9bc7966896e Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:25:01 -0400 Subject: [PATCH] Allow hashes in app data paths --- app/protocol_filter.ts | 3 +-- ts/test-node/app/protocol_filter_test.ts | 30 ------------------------ 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/protocol_filter.ts b/app/protocol_filter.ts index 200d1ab097f6..afb903aae64b 100644 --- a/app/protocol_filter.ts +++ b/app/protocol_filter.ts @@ -42,9 +42,8 @@ export function _urlToPath( : decoded.slice(options?.isWindows ? 8 : 7); const withoutQuerystring = _eliminateAllAfterCharacter(withoutScheme, '?'); - const withoutHash = _eliminateAllAfterCharacter(withoutQuerystring, '#'); - return withoutHash; + return withoutQuerystring; } function _createFileHandler({ diff --git a/ts/test-node/app/protocol_filter_test.ts b/ts/test-node/app/protocol_filter_test.ts index 614384cdac03..f5e4ba1264aa 100644 --- a/ts/test-node/app/protocol_filter_test.ts +++ b/ts/test-node/app/protocol_filter_test.ts @@ -7,16 +7,6 @@ import { _urlToPath } from '../../../app/protocol_filter'; describe('Protocol Filter', () => { describe('_urlToPath', () => { - it('returns proper file path for unix style file URI with hash', () => { - const path = - 'file:///Users/someone/Development/signal/electron/background.html#first-page'; - const expected = - '/Users/someone/Development/signal/electron/background.html'; - - const actual = _urlToPath(path); - assert.strictEqual(actual, expected); - }); - it('returns proper file path for unix style file URI with querystring', () => { const path = 'file:///Users/someone/Development/signal/electron/background.html?name=Signal&locale=en&version=2.4.0'; @@ -27,16 +17,6 @@ describe('Protocol Filter', () => { assert.strictEqual(actual, expected); }); - it('returns proper file path for unix style file URI with hash and querystring', () => { - const path = - 'file:///Users/someone/Development/signal/electron/background.html#somewhere?name=Signal'; - const expected = - '/Users/someone/Development/signal/electron/background.html'; - - const actual = _urlToPath(path); - assert.strictEqual(actual, expected); - }); - it('returns proper file path for file URI on windows', () => { const path = 'file:///C:/Users/Someone/dev/desktop/background.html?name=Signal&locale=en&version=2.4.0'; @@ -57,16 +37,6 @@ describe('Protocol Filter', () => { assert.strictEqual(actual, expected); }); - it('translates from URL format to filesystem format', () => { - const path = - 'file:///Users/someone/Development%20Files/signal/electron/background.html'; - const expected = - '/Users/someone/Development Files/signal/electron/background.html'; - - const actual = _urlToPath(path); - assert.strictEqual(actual, expected); - }); - it('handles UNC path', () => { const path = '//share/path'; const expected = '//share/path';