Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created August 4, 2014 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendanmckenzie/d50b32fbd25bc276dcf7 to your computer and use it in GitHub Desktop.
Save brendanmckenzie/d50b32fbd25bc276dcf7 to your computer and use it in GitHub Desktop.
from config import WEB_ROOT
def init_cors(app):
@app.after_request
def add_cors_headers(response):
response.headers.add('Access-Control-Allow-Origin', WEB_ROOT)
response.headers.add('Access-Control-Allow-Credentials', 'true')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type')
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment