nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.33k stars 523 forks source link

Set up multiple Access-Control-Allow-Origin domains via route rules #2919

Open gxres042 opened 9 hours ago

gxres042 commented 9 hours ago

Describe the feature

In some environments it is necessary to configure multiple Access-Control-Allow-Origins, which is not supported by routeRules at this time. Perhaps we can add one.

Additional information

pi0 commented 9 hours ago

Can you please add little more details also? 🙏🏼 (envs that you tested and failing + current config)

gxres042 commented 9 hours ago

ummm actually I'm working on a new project. This project's full routing requires multiple Access-Control-Allow-Origins domains to be set, but there doesn't seem to be a good way to do this in Nitro yet?

pi0 commented 7 hours ago

It is possible using h3 utils, not route rules AFAIK (unless we manually merged them via ,)

gxres042 commented 7 hours ago

Perhaps we need to improve the documentation on CORS?