From cf5c4c62244ea4738236ee3a2762fa7a19f6805c Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 10 Sep 2023 12:07:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Fix=20CORS=20allowed=20?= =?UTF-8?q?origins=20and=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/main.py b/backend/main.py index 93a4205..1eae69a 100755 --- a/backend/main.py +++ b/backend/main.py @@ -34,13 +34,12 @@ app = FastAPI(lifespan=lifespan) app.add_middleware( CORSMiddleware, - allow_origins=["https://localhost:4443", "https://localhost:3000"], + allow_origins=["http://carrramba.adrien.run", "https://carrramba.adrien.run"], allow_credentials=True, - allow_methods=["*"], + allow_methods=["OPTIONS", "GET"], allow_headers=["*"], ) - # The cache-control header entry is not managed properly by fastapi-cache: # For now, a request with a cache-control set to no-cache # is interpreted as disabling the use of the server cache.