Browse Source

cors issues

main
Domeniko Gentner 10 months ago
parent
commit
7ddd4b7fb7
  1. 12
      server.py

12
server.py

@ -70,7 +70,7 @@ with laberflask.app_context():
# CORS
cors = CORS(laberflask)
cors = CORS(laberflask, resources={r"/comments/*": {"origins": "*"}})
# There is only one user
@ -104,13 +104,3 @@ def inject_language():
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')
response.headers.add('Access-Control-Allow-Methods', 'GET,POST,OPTIONS')
response.headers.add("Access-Control-Allow-Headers",
"Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, "
"Access-Control-Request-Method, Access-Control-Request-Headers")
# response.headers.add('Access-Control-Allow-Credentials', 'true')
return response

Loading…
Cancel
Save