From c8c744f585c7b47c5bc661ec8df7d5caf8d21ed8 Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 22 Aug 2018 11:49:55 -0700 Subject: [PATCH] Default to disallow robots --- README.md | 2 +- index.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fa9fe49..662e77b 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ e.g. `--viewer.port 8807`. - `viewer.img_base`: base url for embedded blobs (images) - `viewer.emoji_base`: base url for emoji images - `viewer.require_opt_in`: whether to serve content from feeds that have not published a `publicWebHosting` `about` message. default: `true` -- `viewer.disallowRobots`: whether to direct search engines to not index the site. default: `false` +- `viewer.disallowRobots`: whether to direct search engines to not index the site. default: `true` ## References diff --git a/index.js b/index.js index 57c411b..c1f05f0 100644 --- a/index.js +++ b/index.js @@ -535,8 +535,9 @@ function serveFile(req, res, file) { } function serveRobots(req, res, conf) { - res.end('User-agent: *' - + (conf.disallowRobots ? '\nDisallow: /' : '')) + var disallow = conf.disallowRobots == null ? true : conf.disallowRobots + res.end('User-agent: *\n' + + (disallow ? 'Disallow: /\n' : '')) } function prepend(fn, arg) {