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

1.10 not compatible with example app #84

Closed
diiq opened this issue Dec 12, 2014 · 3 comments
Closed

1.10 not compatible with example app #84

diiq opened this issue Dec 12, 2014 · 3 comments

Comments

@diiq
Copy link

diiq commented Dec 12, 2014

Your example app suggests I can do something like this:

flask_app.config['CORS_RESOURCES'] = {
    r"/api/*": {
        "origins": ["http://blah.com/*", "http://foo.bar/*"]
    }
}

And indeed, in 1.9.0, I could, and life was peachy.

Upgrading to 1.10 results in origins being "*" regardless of the contents of this configuration, even when the credentials flag is set to true. As my browser immediately informed me,

A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true.

If there's another way I should configure origins, what is it (and can you update the example app)?

@corydolphin
Copy link
Owner

Crap! Looks like a regression! Let me take a look!

Thanks so much for the report!

@corydolphin
Copy link
Owner

  1. You must remove the trailing slashes in the origins to match for them to work correctly, e.g.
    'http://foo'. If you wish to specify a particular port, 'http://foo:9090' will work. You can get as tricky as you want with the regex 🎱 Is there somewhere I gave those exact examples? Please let me know and I will fix the docs ASAP.
  2. My apologies, I have found the issue and fixed it. When I removed some code in bb23a2e#diff-325f0737f784520e5eda4b30f620f792L363 causing incorrect parsing of the resources and intercept_exceptions kwargs and app config options.

I will release 1.10.1 tonight to fix the issue on Pypi.

Thanks for the report and please let me know if there is anything I can do.

@diiq
Copy link
Author

diiq commented Dec 13, 2014

No worries -- the example origins were totally invented. I'll be sure to leave off the trailing slash.

Thanks for the quick fix!

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