From 1fb42bd276ff6806d733c2449a10840ae29903a9 Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Mon, 1 Feb 2016 00:41:28 -0600 Subject: Updated to allow CORS in download as API --- lib/response.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/response.js') diff --git a/lib/response.js b/lib/response.js index daf5fb11..07cb5ba9 100644 --- a/lib/response.js +++ b/lib/response.js @@ -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', -- cgit v1.2.3