From 33bd929308fa9ffe219478dff7efb4c2cee868cd Mon Sep 17 00:00:00 2001 From: Jeremy Wharton Date: Tue, 31 Jan 2023 13:59:21 -0600 Subject: [PATCH] web/satellite: encode file browser URL components File paths may contain characters that have special meaning when placed in URLs. For example, a folder name may contain a pound symbol (#) which is the URL fragment delimiter. This causes the characters that succeed this symbol to not be considered part of the primary resource identifier as they should be, resulting in navigation errors. This change resolves this issue. Resolves #5522 Change-Id: I59972321795375ec5981c3e9c505e35f998022d6 --- web/satellite/src/components/browser/FileEntry.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/satellite/src/components/browser/FileEntry.vue b/web/satellite/src/components/browser/FileEntry.vue index 21bc138ee..12d3edc78 100644 --- a/web/satellite/src/components/browser/FileEntry.vue +++ b/web/satellite/src/components/browser/FileEntry.vue @@ -161,7 +161,8 @@ const dropdownOpen = computed((): boolean => { */ const link = computed((): string => { const browserRoot = store.state.files.browserRoot; - const pathAndKey = store.state.files.path + props.file.Key; + const uriParts = (store.state.files.path + props.file.Key).split('/'); + const pathAndKey = uriParts.map(part => encodeURIComponent(part)).join('/'); return pathAndKey.length > 0 ? browserRoot + pathAndKey + '/' : browserRoot;