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
commit dbf4bd5c3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
}