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
I think if anything allow_origin: '%env(json:CORS_ALLOW_ORIGIN)%' without the [] around might work, but I guess this requires delayed param handling, while this bundle still does it the old school way and computes stuff in the DI Extension which is too early as env vars are not available at that time.
I agree it'd be nice but this is some amount of refactoring I don't have time for unfortunately.
Version
2.4
Question
I'm trying to pass in multiple allow_origin hostnames via .env file
.env:
CORS_ALLOW_ORIGIN='["http://localhost:3001","http://localhost:3002"]'
nelmio_cors.yaml
allow_origin: ['%env(json:CORS_ALLOW_ORIGIN)%']
but it keeps failing
when I do this in nelmio_cors.yaml, it works fine:
allow_origin: ['http://localhost:3001','http://localhost:3002']
Did anyone come across this? TIA 🙏
How could one pass in multiple entries to allow_origin from .env? I'm out of ideas, ChatGPT+ is out of ideas too...
Additional context
Even GPT-4o thinks this should work, but sadly it doesn't (explored different options with ChatGPT too 🫠)
The text was updated successfully, but these errors were encountered: