diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 99bb49ebd5..1fc161c7ff 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -357,7 +357,10 @@ module.exports.removeFile = (path) => { } module.exports.encodeUriPath = (path) => { - const uri = new URL(path, "file://") + const uri = new URL('/', "file://") + // we assign the path here to assure that URL control characters like # are + // actually interpreted as part of the URL path + uri.pathname = path return uri.pathname }