Skip to content

Commit 4f68ba2

Browse files
committed
fix(url): Decode filePath before resolving into an absolute path (regressed by y-scope#286; fixes y-scope#329).
1 parent 05ec53b commit 4f68ba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/url.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ const parseWindowUrlSearchParams = () : Partial<UrlSearchParams> => {
8484
if (-1 !== filePathIndex) {
8585
const filePath = window.location.search.substring(filePathIndex + "filePath=".length);
8686
if (0 !== filePath.length) {
87-
let resolvedFilePath = filePath;
87+
let resolvedFilePath = decodeURIComponent(filePath);
8888
try {
89-
resolvedFilePath = getAbsoluteUrl(filePath);
89+
resolvedFilePath = getAbsoluteUrl(resolvedFilePath);
9090
} catch (e) {
9191
console.error("Unable to get absolute URL from filePath:", e);
9292
}

0 commit comments

Comments
 (0)