Skip to content
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

Question: multiple allow_origin entries #199

Open
ThePeterMick opened this issue May 14, 2024 · 0 comments
Open

Question: multiple allow_origin entries #199

ThePeterMick opened this issue May 14, 2024 · 0 comments

Comments

@ThePeterMick
Copy link

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 🫠)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant