From 02a26e6938545a83937f4ffcc2cb20a3f66ea029 Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <40430746+CaoMeiYouRen@users.noreply.github.com> Date: Fri, 29 May 2020 14:55:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D/robots.txt=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=20(#4874)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/router.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/router.js b/lib/router.js index a4c2d13921..f8348f7ad9 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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