1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Cache robots.txt longer (#36907)

This commit is contained in:
Peter Bengtsson
2023-05-08 11:13:13 -04:00
committed by GitHub
parent 18f42d939e
commit 3ce72b8d58
2 changed files with 23 additions and 11 deletions

View File

@@ -1,3 +1,5 @@
import { defaultCacheControl } from './cache-control.js'
const defaultResponse = 'User-agent: *'
const disallowAll = `User-agent: *
@@ -8,6 +10,8 @@ export default function robots(req, res, next) {
res.type('text/plain')
defaultCacheControl(res)
// 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)