feat(torrent): encodeURI & decodeURI downloaded file name

This commit is contained in:
OldHawk
2017-07-15 00:06:53 +08:00
parent c9a67c137d
commit 2c6474fcb7
6 changed files with 8 additions and 7 deletions

View File

@@ -654,7 +654,7 @@ exports.attachDownload = function (req, res) {
try {
//res.set('Content-Type', 'application/x-bittorrent');
res.set('Content-Disposition', 'attachment; filename=' + req.params.filename);
res.set('Content-Disposition', 'attachment; filename=' + encodeURI(req.params.filename));
res.set('Content-Length', stat.size);
fs.createReadStream(filePath).pipe(res);