mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-07 16:44:16 +01:00
Merge pull request #2691 from lkiesow/hash-in-filename
Fix file names with URL control characters
This commit is contained in:
commit
dbf4bd5c3d
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user