summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-03-15 10:54:21 +0800
committerCheng-Han, Wu2016-03-15 10:54:21 +0800
commitb6ca50072eb01abacb88a1031ffd7c72c42e72ce (patch)
tree51d3df8eb6dbfc0d5c2129f81abe235f31d78d0e /lib
parentc5f6c2bab399c4e4694a26663cd8e5e31ce8350b (diff)
Updated to add headers to prevent search engine crawl some unnecessary paths
Diffstat (limited to '')
-rw-r--r--lib/response.js4
1 files changed, 3 insertions, 1 deletions
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);
});