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

Configuring CORS for all Blueprints via Config #251

Open
mfrlin opened this issue Sep 16, 2019 · 1 comment
Open

Configuring CORS for all Blueprints via Config #251

mfrlin opened this issue Sep 16, 2019 · 1 comment

Comments

@mfrlin
Copy link

mfrlin commented Sep 16, 2019

Is there any way to configure CORS for all Blueprints? If I set up CORS on the app and I register Blueprints then CORS won't work for those Blueprints. So now I have to configure CORS for each Blueprint separately. Furthermore I imagine (docs aren't clear about this) I can configure Flask app with a Config class with CORS_ORIGINS = [...] and it should work. But now CORS does not have access to the app and I have to do it like CORS(blueprint, origins=config_class.CORS_ORIGINS).

Is there a nicer way to do this?

@JJJGGGG
Copy link

JJJGGGG commented Mar 15, 2024

For me, this worked for registered blueprints as app.register_blueprint(...) but if I registered them in a blueprint, i.e. as nested blueprints (blueprint.register_blueprint(...)) it didn't work. Maybe this is the issue

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

2 participants