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

Disable CORS via CLI #19263

Closed
4 tasks done
s2b opened this issue Jan 22, 2025 · 2 comments
Closed
4 tasks done

Disable CORS via CLI #19263

s2b opened this issue Jan 22, 2025 · 2 comments

Comments

@s2b
Copy link

s2b commented Jan 22, 2025

Description

Currently, it's only possible to enable CORS for the dev server via the --cors option. However, with the recent change to enable CORS by default, this option is not really useful anymore. Instead, it should be possible to disable CORS via CLI option to ease the integration of the dev server into local development environments where CORS headers can be problematic.

Suggested solution

The --cors option could either allow a value, like --cors=0, or there could be a new CLI option like --disableCors or similar.

Alternative

No response

Additional context

No response

Validations

@hi-ogawa
Copy link
Collaborator

hi-ogawa commented Jan 23, 2025

Since v6.0.9, cors is disable by default (meaning only same origin request is allowed), so you can enable it back by --cors. Can you clarify your issue? (Also --cors should already support some variants like --no-cors, --cors=true, --cors=false)

@s2b
Copy link
Author

s2b commented Jan 25, 2025

Ah, my bad, you're right. I mixed up what true and false means for cors. But good to know that true/false can be provided via CLI, that's not in the documentation I think.

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

No branches or pull requests

2 participants