Tweaked CORS
This commit is contained in:
13
app/main.py
13
app/main.py
@@ -32,12 +32,21 @@ def create_application() -> FastAPI:
|
||||
application.mount("/static", StaticFiles(directory="app/static"), name="static")
|
||||
|
||||
# Set up CORS
|
||||
origins = [
|
||||
"https://articulateusercontent.com",
|
||||
"https://ai-gateway.ldex.dev",
|
||||
"http://localhost:8000",
|
||||
"http://127.0.0.1:8000",
|
||||
]
|
||||
|
||||
application.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=False, # Changed to False for better compat with allow_origins=["*"]
|
||||
allow_origins=origins,
|
||||
allow_origin_regex=r"https://.*\.articulateusercontent\.com",
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
expose_headers=["*"],
|
||||
)
|
||||
|
||||
# Set up Rate Limiter
|
||||
|
||||
Reference in New Issue
Block a user