mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-25 13:24:57 +02:00
x-accel: encode all paths to URIs
updates util function encodeUriPath to use node:url with a file:// path prefix, and updates all instances x-accel redirection to use this helper util instead of sending unencoded paths into the header.
This commit is contained in:
parent
e56b8edc0a
commit
207ba7ec8e
4 changed files with 26 additions and 16 deletions
|
@ -293,5 +293,6 @@ module.exports.removeFile = (path) => {
|
|||
}
|
||||
|
||||
module.exports.encodeUriPath = (path) => {
|
||||
return filePathToPOSIX(path).replace(/%/g, '%25').replace(/#/g, '%23')
|
||||
const uri = new URL(path, "file://")
|
||||
return uri.pathname
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue