mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 10:14:36 +02:00
Merge pull request #2691 from lkiesow/hash-in-filename
Fix file names with URL control characters
This commit is contained in:
commit
dbf4bd5c3d
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue