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
For nested routes, @koa/router rejects CORS preflight requests as 404s because there's not an explicit endpoint defined for these OPTIONS requests. As a workaround, I'm explicitly adding endpoints, eg:
Where somePathDefinition is a path-to-regex. Is there something better to use than the above matching '(.*)' but easier to maintain than a whitelist of routes?
The text was updated successfully, but these errors were encountered:
Thanks. Just tried it but it breaks some tests, returning an undesired 200 to endpoints that don't want requests from browsers.
I tried applying it to just an individual nested router without success, getting 404s again with router.use(router.allowedMethods()); instead of app.use(router.allowedMethods());
For nested routes, @koa/router rejects CORS preflight requests as 404s because there's not an explicit endpoint defined for these OPTIONS requests. As a workaround, I'm explicitly adding endpoints, eg:
Where
somePathDefinition
is a path-to-regex. Is there something better to use than the above matching'(.*)'
but easier to maintain than a whitelist of routes?The text was updated successfully, but these errors were encountered: