Skip to content

Commit afc318b

Browse files
authored
fix(url): Decode filePath before resolving into an absolute path (fixes #109). (#295)
1 parent af6c219 commit afc318b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/contexts/UrlContextProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ const getWindowUrlSearchParams = () => {
187187
// This ensures any parameters following `filePath=` are incorporated into the `filePath`.
188188
const [, filePath] = window.location.search.split("filePath=");
189189
if ("undefined" !== typeof filePath && 0 !== filePath.length) {
190-
let resolvedFilePath = filePath;
190+
let resolvedFilePath = decodeURIComponent(filePath);
191191
try {
192-
resolvedFilePath = getAbsoluteUrl(filePath);
192+
resolvedFilePath = getAbsoluteUrl(resolvedFilePath);
193193
} catch (e) {
194194
console.error("Unable to get absolute URL from filePath:", e);
195195
}

0 commit comments

Comments
 (0)