From 73d7a711409317a2a17ab10e0dfa20d9070b4a76 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Fri, 16 May 2025 05:41:49 +0000 Subject: [PATCH] Configure CORS to allow all origins --- main.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index c6987bf..83866e7 100644 --- a/main.py +++ b/main.py @@ -6,15 +6,14 @@ from app.core.config import settings app = FastAPI(title=settings.PROJECT_NAME) -# Set all CORS enabled origins -if settings.BACKEND_CORS_ORIGINS: - app.add_middleware( - CORSMiddleware, - allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS], - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], - ) +# Set all CORS enabled origins - Allow all origins +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) app.include_router(api_router)