From 839be6477d4b5870a03c82791af5a156882eadcb Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 24 Aug 2018 05:26:26 +0900 Subject: [PATCH 1/2] Return 404 for unknown API --- src/server/api/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 3ec7a28df9..a8f6455d9a 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -46,6 +46,11 @@ router.post('/signin', require('./private/signin').default); router.use(require('./service/github').routes()); router.use(require('./service/twitter').routes()); +// Return 404 for unknown API +router.all('*', async ctx => { + ctx.status = 404; +}); + // Register router app.use(router.routes()); From 5b5de6a89c26f2f32dc4f32a9657975994a8c503 Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 24 Aug 2018 05:41:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9HTML=E3=81=AF=20?= =?UTF-8?q?immutable=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/web/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 7291f8a0a5..452e36fe95 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -122,8 +122,7 @@ router.get('/notes/:note', async ctx => { router.get('*', async ctx => { await send(ctx, `app/base.html`, { root: client, - maxage: ms('3 days'), - immutable: true + maxage: ms('5m') }); });