Updated to allow CORS in download as API

This commit is contained in:
Cheng-Han, Wu 2016-02-01 00:41:28 -06:00
parent dcebc75d39
commit 1fb42bd276

View file

@ -324,6 +324,7 @@ function actionDownload(req, res, noteId) {
var body = LZString.decompressFromBase64(data.rows[0].content);
var title = Note.getNoteTitle(body);
res.writeHead(200, {
'Access-Control-Allow-Origin': '*', //allow CORS as API
'Content-Type': 'text/markdown; charset=UTF-8',
'Cache-Control': 'private',
'Content-disposition': 'attachment; filename=' + title + '.md',