""" | |
Enable CORS. Disable it if you don't need CORS | |
""" | |
@app.after_request | |
def after_request(response): | |
response.headers["Access-Control-Allow-Origin"] = "*" # <- You can change "*" for a domain for example "http://localhost" | |
response.headers["Access-Control-Allow-Credentials"] = "true" | |
response.headers["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE" | |
response.headers["Access-Control-Allow-Headers"] = "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization" | |
return response | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment