You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ... a bunch of router.get()s;// catch all for GETrouter.get('/(.*)',(ctx)=>{ctx.status=404;ctx.body='Error 404 Not Found';});// catch all for all other verbsrouter.all('/(.*)',(ctx)=>{ctx.status=405;ctx.body='Error 405 Method Not Allowed';});app.use(router.routes()).use(router.allowedMethods());app.listen(3000);
Koa version: 2.13.4
@koa/router version: 11.0.1
Test 1: Request [GET] http://localhost:3000/ // outputs 'Hello' (200) ✅
Test 2: Request [GET] http://localhost:3000/foo // outputs 'not found' (404) ✅
Test 3: Request [POST] http://localhost:3000/ // outputs 'not found' (405) expected Method not allowed ❌
If I try to log out the ctx.status in the final middleware for Test 3 it always show (404) - I never see the 405 from allowedMethods
The text was updated successfully, but these errors were encountered: