From 923fbfc574f725f59fe2bc592fda30838bdfc9f0 Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 7 Jan 2015 12:37:16 +0000 Subject: [PATCH] Correctly handle quote characters in template name when downloading --- .../app/coffee/Features/Templates/TemplatesWebController.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Templates/TemplatesWebController.coffee b/services/web/app/coffee/Features/Templates/TemplatesWebController.coffee index 22c5e9b83d..0185dfcfe8 100644 --- a/services/web/app/coffee/Features/Templates/TemplatesWebController.coffee +++ b/services/web/app/coffee/Features/Templates/TemplatesWebController.coffee @@ -45,7 +45,7 @@ module.exports = TemplatesWebController = disposition = "inline" else disposition = "attachment" - res.header({"content-disposition": "#{disposition}; filename=#{name}.#{req.params.file_type};"}) + res.header({"content-disposition": "#{disposition}; filename=\"#{name.replace("\"", "-")}.#{req.params.file_type}\""}) logger.log url:url, template_name: name, disposition: disposition, "proxying request to templates api"