Selectively enable CORS. (#1220)

This commit is contained in:
kevgliss 2018-04-24 17:10:38 -07:00 committed by GitHub
parent 3e5db9eedb
commit e09b7eb978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -124,8 +124,10 @@ def configure_extensions(app):
smtp_mail.init_app(app) smtp_mail.init_app(app)
metrics.init_app(app) metrics.init_app(app)
sentry.init_app(app) sentry.init_app(app)
app.config['CORS_HEADERS'] = 'Content-Type'
cors.init_app(app, resources=r'/api/*', headers='Content-Type', origin='*', supports_credentials=True) if app.config['CORS']:
app.config['CORS_HEADERS'] = 'Content-Type'
cors.init_app(app, resources=r'/api/*', headers='Content-Type', origin='*', supports_credentials=True)
def configure_blueprints(app, blueprints): def configure_blueprints(app, blueprints):