Skip to content

Commit b6ca500

Browse files
committed
Updated to add headers to prevent search engine crawl some unnecessary paths
1 parent c5f6c2b commit b6ca500

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/response.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ function actionDownload(req, res, noteId) {
334334
'Content-Type': 'text/markdown; charset=UTF-8',
335335
'Cache-Control': 'private',
336336
'Content-disposition': 'attachment; filename=' + filename + '.md',
337-
'Content-Length': body.length
337+
'Content-Length': body.length,
338+
'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
338339
});
339340
res.end(body);
340341
});
@@ -367,6 +368,7 @@ function actionPDF(req, res, noteId) {
367368
res.setHeader('Content-disposition', 'attachment; filename="' + filename + '.pdf"');
368369
res.setHeader('Cache-Control', 'private');
369370
res.setHeader('Content-Type', 'application/pdf; charset=UTF-8');
371+
res.setHeader('X-Robots-Tag', 'noindex, nofollow'); // prevent crawling
370372
stream.pipe(res);
371373
fs.unlink(path);
372374
});

0 commit comments

Comments
 (0)