ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix download filename with special chars
Chocobozzzede06cfb402c
diff --git a/server/core/controllers/download.ts b/server/core/controllers/download.tsindex fc861c972b..cce22599db 100644--- a/server/core/controllers/download.ts+++ b/server/core/controllers/download.ts@@ -135,7 +135,7 @@ async function downloadTorrent (req: express.Request, res: express.Response) {// Proxify remote request without cacheres.type('application/x-bittorrent')- res.setHeader('Content-disposition', contentDisposition(encodeURI(downloadFilename)))+ res.setHeader('Content-disposition', contentDisposition(downloadFilename))const remoteUrl = file.getRemoteTorrentUrl(video)@@ -284,7 +284,7 @@ async function downloadGeneratedVideoFile (req: express.Request, res: express.Reconst urlPath = new URL(req.originalUrl, WEBSERVER.URL).pathnameif (!urlPath.endsWith('.mp4') && !urlPath.endsWith('.m4a')) {const downloadFilename = buildDownloadFilename({ video, extname })- res.setHeader('Content-disposition', contentDisposition(encodeURI(downloadFilename)))+ res.setHeader('Content-disposition', contentDisposition(downloadFilename))}res.type(extname)@@ -413,7 +413,7 @@ async function downloadLocalFileWithOptionalThrottle (options: {if (!totalBytesPerSecond && !bytesPerIpPerSecond) return res.download(path, downloadFilename)- res.setHeader('Content-Disposition', contentDisposition(encodeURI(downloadFilename)))+ res.setHeader('Content-Disposition', contentDisposition(downloadFilename))res.setHeader('Content-Type', 'application/octet-stream')const readStream = createReadStream(path)