From a9fa72578cb2baf6aaa69de8363c1212f1b281eb Mon Sep 17 00:00:00 2001 From: Junhao Liao Date: Mon, 9 Dec 2024 12:09:05 -0500 Subject: [PATCH] Decode URL parameter `filePath` once read. --- src/contexts/UrlContextProvider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/contexts/UrlContextProvider.tsx b/src/contexts/UrlContextProvider.tsx index 5862aa9d..81a314ea 100644 --- a/src/contexts/UrlContextProvider.tsx +++ b/src/contexts/UrlContextProvider.tsx @@ -186,7 +186,8 @@ const getWindowUrlSearchParams = () => { // This ensures any parameters following `filePath=` are incorporated into the `filePath`. const [, filePath] = window.location.search.split("filePath="); if ("undefined" !== typeof filePath && 0 !== filePath.length) { - searchParams[SEARCH_PARAM_NAMES.FILE_PATH] = getAbsoluteUrl(filePath); + const decodedFilePath = decodeURIComponent(filePath); + searchParams[SEARCH_PARAM_NAMES.FILE_PATH] = getAbsoluteUrl(decodedFilePath); } }