Default to disallow robots

This commit is contained in:
cel
2018-08-22 11:52:43 -07:00
parent f908ea40e6
commit c8c744f585
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ e.g. `--viewer.port 8807`.
- `viewer.img_base`: base url for embedded blobs (images) - `viewer.img_base`: base url for embedded blobs (images)
- `viewer.emoji_base`: base url for emoji 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.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 ## References
+3 -2
View File
@@ -535,8 +535,9 @@ function serveFile(req, res, file) {
} }
function serveRobots(req, res, conf) { function serveRobots(req, res, conf) {
res.end('User-agent: *' var disallow = conf.disallowRobots == null ? true : conf.disallowRobots
+ (conf.disallowRobots ? '\nDisallow: /' : '')) res.end('User-agent: *\n'
+ (disallow ? 'Disallow: /\n' : ''))
} }
function prepend(fn, arg) { function prepend(fn, arg) {