-
Notifications
You must be signed in to change notification settings - Fork 9
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
CORS Support #28
Comments
@lkskstlr I was also trying to find this option. Since CORS is likely intended for local development, you can use the following monkey patch to achieve the same effect:
|
Hi all, I am having the same issues with Cors. Outside of Postman I can not make any calls to my Banana instance. Not on localhost, not even on a AWS Cloudfront/s3 with https. @jaxball how exactly does your code tie into creating an app with Potassium like this: Thank you so much, |
Thanks @jaxball that works! Here's an example of the code (note the Flask import isn't required): from potassium import Potassium, Request, Response
# for CORS support
def new_create_flask_app(self):
flask_app = original_create_flask_app(self)
@flask_app.after_request
def add_cors_headers(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
return response
return flask_app
# monkey patch the new method
original_create_flask_app = Potassium._create_flask_app
Potassium._create_flask_app = new_create_flask_app
app = Potassium("my_app") |
Hi all,
I really like your service, but it seems that CORS is missing (or is there a recommended workaround)? I think it shouldn't be hard to add it, given that you have a thin wrapper around Flask. Is this on your timeline and if so, what would be the approximate timing?
Thanks
Lukas
The text was updated successfully, but these errors were encountered: