diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-08-24 05:40:30 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-24 05:40:30 +0900 |
| commit | a11c991f83fbd0c9065f0662e532339424e9967e (patch) | |
| tree | 3e600edf492612082673378583dcb19a4d0b18c4 /src/server/api | |
| parent | 8.2.0 (diff) | |
| parent | Return 404 for unknown API (diff) | |
| download | sharkey-a11c991f83fbd0c9065f0662e532339424e9967e.tar.gz sharkey-a11c991f83fbd0c9065f0662e532339424e9967e.tar.bz2 sharkey-a11c991f83fbd0c9065f0662e532339424e9967e.zip | |
Merge pull request #2436 from mei23/mei-0824-api404
/api/ 下の存在しないにURL対しては404を返すようにする
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/index.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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()); |