mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
fix: 修复/robots.txt路由 (#4874)
This commit is contained in:
@@ -22,14 +22,13 @@ for (const project in RouterPath) {
|
||||
// index
|
||||
router.get('/', require('./routes/index'));
|
||||
|
||||
router.get('/robots.txt', async (ctx, next) => {
|
||||
router.get('/robots.txt', async (ctx) => {
|
||||
if (config.disallowRobot) {
|
||||
ctx.set('Content-Type', 'text/plain');
|
||||
ctx.body = 'User-agent: *\nDisallow: /';
|
||||
} else {
|
||||
ctx.throw(404, 'Not Found');
|
||||
}
|
||||
await next();
|
||||
});
|
||||
|
||||
// test
|
||||
|
||||
Reference in New Issue
Block a user