diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-03 14:28:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-03 14:28:43 +0200 |
commit | 62f53731cf807562ba885b180e71bb75b3902443 (patch) | |
tree | 676f8b6921b93e1e3e036f9eac133c37b0599ff9 | |
parent | 5a2f775a212bcb708f1756e3780c764cc232a910 (diff) | |
download | PeerTube-62f53731cf807562ba885b180e71bb75b3902443.tar.gz PeerTube-62f53731cf807562ba885b180e71bb75b3902443.tar.zst PeerTube-62f53731cf807562ba885b180e71bb75b3902443.zip |
Fix invalid download filename
-rw-r--r-- | server/controllers/download.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/download.ts b/server/controllers/download.ts index 43d525f83..a270180c0 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts | |||
@@ -86,7 +86,9 @@ async function downloadVideoFile (req: express.Request, res: express.Response) { | |||
86 | } | 86 | } |
87 | 87 | ||
88 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => { | 88 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => { |
89 | const filename = `${video.name}-${videoFile.resolution}p${videoFile.extname}` | 89 | // Express uses basename on filename parameter |
90 | const videoName = video.name.replace(/[/\\]/g, '_') | ||
91 | const filename = `${videoName}-${videoFile.resolution}p${videoFile.extname}` | ||
90 | 92 | ||
91 | return res.download(path, filename) | 93 | return res.download(path, filename) |
92 | }) | 94 | }) |