New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route rules with cors: true
does not work
#2340
Comments
Hi @pi0 @danielroe , I digged deeper into this and found a critical bug with route rules not beeing applied. Maybe a problem with https://github.com/unjs/radix3? The following rule works for all routes:
BUT if a route does not have GET route, the routeRoule is not applied. E.g.:
Therefor the routes without a GET route throw a cors error in my case. This could also explain nuxt/nuxt#25686 I made a reproduction repo, you can simply run |
Environment
Reproduction
https://stackblitz.com/edit/github-xaqmuq?file=nitro.config.ts
Describe the bug
Setting
cors: true
to does not work:The browser still throws cors error:
With header, too:
Error:
Additional context
I already opened an issue at Nuxt that setting
corse:true
does not have an effect on/api
routes, only on/public
folder.Logs
No response
The text was updated successfully, but these errors were encountered: