mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-04 16:09:59 +02:00
opt(core): optimization file download with encodeURIComponent and UTF-8 on filename
This commit is contained in:
@@ -74,7 +74,7 @@ exports.download = function (req, res) {
|
||||
|
||||
try {
|
||||
res.set('Content-Type', 'application/octet-stream');
|
||||
res.set('Content-Disposition', 'attachment; filename=' + encodeURI(req.params.filename));
|
||||
res.set('Content-Disposition', 'attachment; filename*=UTF-8\'\'' + encodeURIComponent(req.params.filename));
|
||||
res.set('Content-Length', stat.size);
|
||||
|
||||
fs.createReadStream(filePath).pipe(res);
|
||||
|
||||
Reference in New Issue
Block a user