disable cors UwU

This commit is contained in:
maaa 2024-02-27 20:20:07 +01:00
parent b4006fb96c
commit 692bdb9c10
1 changed files with 8 additions and 0 deletions

8
main
View File

@ -96,6 +96,14 @@ def check_username_taken(username):
return "error"
return post["id"]
# Disable CORS
@app.after_request
async def add_cors_headers(response):
response.headers.add("Access-Control-Allow-Origin", "*")
response.headers.add("Access-Control-Allow-Headers", "*")
response.headers.add("Access-Control-Allow-Methods", "*")
return response
# Main page
@app.route("/")
async def main():