git ssb

3+

cel / ssb-npm-registry



Commit 346880254131cb63c5ae020ca49fd4b6b7c0d4da

Serve robots.txt

cel committed on 8/15/2018, 5:55:28 AM
Parent: 62b4a27ac9eb2784595f2f9224d65c5db9ac5bd1

Files changed

index.jschanged
index.jsView
@@ -475,8 +475,9 @@
475475 pathname = m[3]
476476 }
477477 if (pathname === '/') return this.serveHome()
478478 if (pathname === '/bootstrap') return this.serveBootstrap()
479 + if (pathname === '/robots.txt') return this.serveRobots()
479480 if (pathname === '/-/whoami') return this.serveWhoami()
480481 if (pathname === '/-/ping') return this.respond(200, true)
481482 if (pathname === '/-/user/org.couchdb.user:1') return this.serveUser1()
482483 if ((m = /^\/-\/prebuild\/(.*)$/.exec(pathname))) return this.servePrebuild(m[1])
@@ -621,8 +622,13 @@
621622 self.res.end(script)
622623 })
623624 }
624625
626 +Req.prototype.serveRobots = function () {
627 + this.res.writeHead(200, {'Content-type': 'text/plain'})
628 + this.res.end('User-agent: *\nDisallow: /\n')
629 +}
630 +
625631 Req.prototype.serveWhoami = function () {
626632 var self = this
627633 self.server.sbot.whoami(function (err, feed) {
628634 if (err) return self.respondError(500, err.stack || err)

Built with git-ssb-web