From e4ac171f364861f2307fe5325b1639ba53cf757c Mon Sep 17 00:00:00 2001 From: qvalentin Date: Mon, 28 Feb 2022 14:18:48 +0100 Subject: [PATCH] Fix url decoding making folders with umlauts accessable again --- src/background/api/filesystem.ts | 2 +- src/components/pages/filesytem/FilesBreadcrumb.tsx | 2 +- .../__tests__/__snapshots__/FilesBreadcrumb.test.tsx.snap | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/background/api/filesystem.ts b/src/background/api/filesystem.ts index 0a3be370..b608eb39 100644 --- a/src/background/api/filesystem.ts +++ b/src/background/api/filesystem.ts @@ -32,7 +32,7 @@ export const getFolderContents = (path: string) => { return new Promise>((resolve, reject) => { let config = { headers: { - "X-FF-PATH": path, + "X-FF-PATH": decodeURI(path), }, } Axios.get(hostname + filesystemPath + "contents", config) diff --git a/src/components/pages/filesytem/FilesBreadcrumb.tsx b/src/components/pages/filesytem/FilesBreadcrumb.tsx index 21dcf931..92f4619f 100644 --- a/src/components/pages/filesytem/FilesBreadcrumb.tsx +++ b/src/components/pages/filesytem/FilesBreadcrumb.tsx @@ -35,7 +35,7 @@ export function FilesBreadcrumb(props: Props): ReactElement { } key={i} > - {folder}{" "} + {decodeURI(folder)} ) })} diff --git a/src/components/pages/filesytem/__tests__/__snapshots__/FilesBreadcrumb.test.tsx.snap b/src/components/pages/filesytem/__tests__/__snapshots__/FilesBreadcrumb.test.tsx.snap index f8dc03d0..741073dc 100644 --- a/src/components/pages/filesytem/__tests__/__snapshots__/FilesBreadcrumb.test.tsx.snap +++ b/src/components/pages/filesytem/__tests__/__snapshots__/FilesBreadcrumb.test.tsx.snap @@ -22,21 +22,18 @@ Object { href="/file/bla" > bla - fasel - file - @@ -60,21 +57,18 @@ Object { href="/file/bla" > bla - fasel - file -