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
If you use router.allowedMethods() before koa404Handler you get a 404 returned for all OPTIONS requests. Maybe something needs to be added to the docs or something may need to be changed to allow it to work in any order.
I'd suggest just checking if the Allow header is set as that means it'll be an OPTIONS request.
// Mount the app's defined and nested routesapp.use(router.routes());// 404 handlerapp.use(koa404Handler);// Options methodapp.use(router.allowedMethods({throw: true,notImplemented: ()=>newBoom.notImplemented(),methodNotAllowed: ()=>newBoom.methodNotAllowed()}));
The text was updated successfully, but these errors were encountered:
If you use
router.allowedMethods()
beforekoa404Handler
you get a 404 returned for allOPTIONS
requests. Maybe something needs to be added to the docs or something may need to be changed to allow it to work in any order.I'd suggest just checking if the
Allow
header is set as that means it'll be an OPTIONS request.The text was updated successfully, but these errors were encountered: