mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-22 23:32:24 +01:00
opt(core): optimization file download with encodeURIComponent and UTF-8 on filename
This commit is contained in:
@@ -1025,7 +1025,7 @@ exports.attachDownload = function (req, res) {
|
||||
|
||||
try {
|
||||
//res.set('Content-Type', 'application/x-bittorrent');
|
||||
res.set('Content-Disposition', 'attachment; filename=' + encodeURI(filename));
|
||||
res.set('Content-Disposition', 'attachment; filename*=UTF-8\'\'' + encodeURIComponent(filename));
|
||||
res.set('Content-Length', stat.size);
|
||||
|
||||
fs.createReadStream(filePath).pipe(res);
|
||||
|
||||
Reference in New Issue
Block a user