File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -130,4 +130,13 @@ def __init__(self):
130130 self .mongo = MongoConfig ()
131131
132132
133+ class CorsConfig :
134+ """
135+ Configuration class for the Cors configuration.
136+ """
137+
138+ def __init__ (self ):
139+ self .origins = os .getenv ("CORS_ORIGINS" , "*" ).split ("," )
140+
141+
133142config = Config ()
Original file line number Diff line number Diff line change 1717from src .services .api .routes .ingest import ingest_router
1818from src .services .api .routes .retrieve import retrieve_router
1919from src .services .api .routes .meta import meta_router
20+ from src .config import config
2021
2122app = FastAPI ()
2223
2324app .add_middleware (
2425 CORSMiddleware ,
25- allow_origins = [ "*" ] ,
26+ allow_origins = config . cors . origins ,
2627 allow_credentials = True ,
2728 allow_methods = ["*" ],
2829 allow_headers = ["*" ],
You can’t perform that action at this time.
0 commit comments