Correctly handle quote characters in template name when downloading

This commit is contained in:
James Allen 2015-01-07 12:37:16 +00:00
parent aec80fb1db
commit 923fbfc574

View file

@ -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"