Merge pull request #2691 from lkiesow/hash-in-filename

Fix file names with URL control characters
This commit is contained in:
advplyr
2024-03-12 17:40:37 -05:00
committed by GitHub

View File

@@ -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
}