Commit 346880254131cb63c5ae020ca49fd4b6b7c0d4da
Serve robots.txt
cel committed on 8/15/2018, 5:55:28 AMParent: 62b4a27ac9eb2784595f2f9224d65c5db9ac5bd1
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -475,8 +475,9 @@ | |||
475 | 475 … | pathname = m[3] | |
476 | 476 … | } | |
477 | 477 … | if (pathname === '/') return this.serveHome() | |
478 | 478 … | if (pathname === '/bootstrap') return this.serveBootstrap() | |
479 … | + if (pathname === '/robots.txt') return this.serveRobots() | ||
479 | 480 … | if (pathname === '/-/whoami') return this.serveWhoami() | |
480 | 481 … | if (pathname === '/-/ping') return this.respond(200, true) | |
481 | 482 … | if (pathname === '/-/user/org.couchdb.user:1') return this.serveUser1() | |
482 | 483 … | if ((m = /^\/-\/prebuild\/(.*)$/.exec(pathname))) return this.servePrebuild(m[1]) | |
@@ -621,8 +622,13 @@ | |||
621 | 622 … | self.res.end(script) | |
622 | 623 … | }) | |
623 | 624 … | } | |
624 | 625 … | ||
626 … | +Req.prototype.serveRobots = function () { | ||
627 … | + this.res.writeHead(200, {'Content-type': 'text/plain'}) | ||
628 … | + this.res.end('User-agent: *\nDisallow: /\n') | ||
629 … | +} | ||
630 … | + | ||
625 | 631 … | Req.prototype.serveWhoami = function () { | |
626 | 632 … | var self = this | |
627 | 633 … | self.server.sbot.whoami(function (err, feed) { | |
628 | 634 … | if (err) return self.respondError(500, err.stack || err) |
Built with git-ssb-web