Commit c8c744f585c7b47c5bc661ec8df7d5caf8d21ed8
Default to disallow robots
cel committed on 8/22/2018, 6:52:43 PMParent: f908ea40e6521e38fb50bce65d3f4bf95be556a6
Files changed
README.md | changed |
index.js | changed |
README.md | |||
---|---|---|---|
@@ -82,9 +82,9 @@ | |||
82 | 82 … | - `viewer.blob_base`: base url for links to ssb blobs | |
83 | 83 … | - `viewer.img_base`: base url for embedded blobs (images) | |
84 | 84 … | - `viewer.emoji_base`: base url for emoji images | |
85 | 85 … | - `viewer.require_opt_in`: whether to serve content from feeds that have not published a `publicWebHosting` `about` message. default: `true` | |
86 | -- `viewer.disallowRobots`: whether to direct search engines to not index the site. default: `false` | ||
86 … | +- `viewer.disallowRobots`: whether to direct search engines to not index the site. default: `true` | ||
87 | 87 … | ||
88 | 88 … | ## References | |
89 | 89 … | ||
90 | 90 … | - Concept: [ssb-porthole][] |
index.js | ||
---|---|---|
@@ -534,10 +534,11 @@ | ||
534 | 534 … | }) |
535 | 535 … | } |
536 | 536 … | |
537 | 537 … | function serveRobots(req, res, conf) { |
538 | - res.end('User-agent: *' | |
539 | - + (conf.disallowRobots ? '\nDisallow: /' : '')) | |
538 … | + var disallow = conf.disallowRobots == null ? true : conf.disallowRobots | |
539 … | + res.end('User-agent: *\n' | |
540 … | + + (disallow ? 'Disallow: /\n' : '')) | |
540 | 541 … | } |
541 | 542 … | |
542 | 543 … | function prepend(fn, arg) { |
543 | 544 … | return function (read) { |
Built with git-ssb-web