From b6ca50072eb01abacb88a1031ffd7c72c42e72ce Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Tue, 15 Mar 2016 10:54:21 +0800 Subject: Updated to add headers to prevent search engine crawl some unnecessary paths --- lib/response.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/response.js b/lib/response.js index 488cf864..4e5fac3b 100644 --- a/lib/response.js +++ b/lib/response.js @@ -334,7 +334,8 @@ function actionDownload(req, res, noteId) { 'Content-Type': 'text/markdown; charset=UTF-8', 'Cache-Control': 'private', 'Content-disposition': 'attachment; filename=' + filename + '.md', - 'Content-Length': body.length + 'Content-Length': body.length, + 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling }); res.end(body); }); @@ -367,6 +368,7 @@ function actionPDF(req, res, noteId) { res.setHeader('Content-disposition', 'attachment; filename="' + filename + '.pdf"'); res.setHeader('Cache-Control', 'private'); res.setHeader('Content-Type', 'application/pdf; charset=UTF-8'); + res.setHeader('X-Robots-Tag', 'noindex, nofollow'); // prevent crawling stream.pipe(res); fs.unlink(path); }); -- cgit v1.2.3