diff --git a/src/apps.js b/src/apps.js index c729eb9a9..72c88df79 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1393,6 +1393,7 @@ function downloadFile(appId, filePath, callback) { assert.strictEqual(typeof filePath, 'string'); assert.strictEqual(typeof callback, 'function'); + debug(`downloadFile: ${filePath}`); // no need to escape filePath because we don't rely on bash exec(appId, { cmd: [ 'stat', '--printf=%F-%s', filePath ], tty: true }, function (error, stream) { if (error) return callback(error); diff --git a/src/routes/apps.js b/src/routes/apps.js index db853fd53..3979dd1b6 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -598,7 +598,7 @@ function downloadFile(req, res, next) { var headers = { 'Content-Type': 'application/octet-stream', - 'Content-Disposition': 'attachment; filename="' + info.filename + '"' + 'Content-Disposition': `attachment; filename*=utf-8''${encodeURIComponent(info.filename)}` // RFC 2184 section 4 }; if (info.size) headers['Content-Length'] = info.size;