cors issues

main
Domeniko Gentner 4 years ago
parent 464f45cbb9
commit fa63472d8c
  1. 9
      server.py

@ -102,3 +102,12 @@ def set_sqlite_pragma(dbapi_connection, connection_record):
def inject_language(): def inject_language():
lang = Language(request) lang = Language(request)
return {"i18n": lang.i18n} return {"i18n": lang.i18n}
@laberflask.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Methods', 'GET,POST,,OPTIONS')
response.headers.add('Access-Control-Allow-Credentials', 'true')
return response

Loading…
Cancel
Save