diff --git a/source/operations/directoryContents.ts b/source/operations/directoryContents.ts index 8caf9034..d41d4152 100644 --- a/source/operations/directoryContents.ts +++ b/source/operations/directoryContents.ts @@ -76,7 +76,9 @@ function getDirectoryFiles( const filename = serverBase === "/" ? decodeURIComponent(normalisePath(href)) - : decodeURIComponent(normalisePath(pathPosix.relative(serverBase, href))); + : normalisePath( + pathPosix.relative(decodeURIComponent(serverBase), decodeURIComponent(href)) + ); return prepareFileFromProps(props, filename, isDetailed); });