1
0
mirror of synced 2026-01-09 06:03:09 -05:00

Merge branch 'main' into repo-sync

This commit is contained in:
docubot
2021-11-23 10:57:02 -08:00
committed by GitHub

View File

@@ -8,14 +8,10 @@ export default function robots(req, res, next) {
res.type('text/plain')
// remove subdomain from host
// docs-internal-12345--branch-name.herokuapp.com -> herokuapp.com
const rootDomain = req.hostname.split('.').slice(1).join('.')
// prevent crawlers from indexing staging apps
if (rootDomain === 'herokuapp.com') {
return res.send(disallowAll)
// only include robots.txt when it's our production domain and adding localhost for robots-txt.js test
if (req.hostname === 'docs.github.com' || req.hostname === '127.0.0.1') {
return res.send(defaultResponse)
}
return res.send(defaultResponse)
return res.send(disallowAll)
}