]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/download.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / controllers / download.ts
index 43d525f83a0de14ed9f24bffe348b704e31941fd..a270180c0228e6b3250779e1705160e1b296be4d 100644 (file)
@@ -86,7 +86,9 @@ async function downloadVideoFile (req: express.Request, res: express.Response) {
   }
 
   await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => {
-    const filename = `${video.name}-${videoFile.resolution}p${videoFile.extname}`
+    // Express uses basename on filename parameter
+    const videoName = video.name.replace(/[/\\]/g, '_')
+    const filename = `${videoName}-${videoFile.resolution}p${videoFile.extname}`
 
     return res.download(path, filename)
   })