Skip to content

Commit

Permalink
Merge pull request #2691 from lkiesow/hash-in-filename
Browse files Browse the repository at this point in the history
Fix file names with URL control characters
  • Loading branch information
advplyr authored Mar 12, 2024
2 parents 77559d2 + 987842e commit dbf4bd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit dbf4bd5

Please sign in to comment.