From 4920d04f62dd44db7a31f3331b22b0a8ba6ab3ba Mon Sep 17 00:00:00 2001 From: Paul Kerschen Date: Mon, 9 Oct 2017 14:53:36 -0700 Subject: [PATCH] COL-1203 URI-encode filename header when downloading assets --- node_modules/col-assets/lib/rest.js | 2 +- node_modules/col-core/lib/api.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/col-assets/lib/rest.js b/node_modules/col-assets/lib/rest.js index bc76fefb..d704b983 100644 --- a/node_modules/col-assets/lib/rest.js +++ b/node_modules/col-assets/lib/rest.js @@ -346,7 +346,7 @@ Collabosphere.apiRouter.get('/assets/:assetId/download', function(req, res) { Storage.getObject(s3ObjectKey, function(data) { var filename = _.split(s3ObjectKey, '/').pop(); - res.set('Content-Disposition', util.format('attachment; filename="%s"', filename)); + res.set('Content-Disposition', util.format('attachment; filename="%s"', encodeURIComponent(filename))); data.createReadStream().pipe(res); return res.status(200); diff --git a/node_modules/col-core/lib/api.js b/node_modules/col-core/lib/api.js index 06c5e621..2d0c1c58 100644 --- a/node_modules/col-core/lib/api.js +++ b/node_modules/col-core/lib/api.js @@ -60,7 +60,7 @@ var init = module.exports.init = function(callback) { // guarantee that the system is functioning properly anymore so we kill the process. When running // in production, the service script will automatically respawn the instance process.on('uncaughtException', function(err) { - log.error({'err': err}, 'Uncaught exception was raised, restarting the process'); + log.error({'err': err, 'stack': err.stack}, 'Uncaught exception was raised, restarting the process'); process.exit(1); });