mirror of https://github.com/Chocobozzz/PeerTube
Fix invalid download filename
parent
5a2f775a21
commit
62f53731cf
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue