mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix CORS configuration.
We need to configure this always, but limit the allowed origins for non- dev modes. https://github.com/dcs-liberation/dcs_liberation/issues/2039
This commit is contained in:
parent
17f2f007d2
commit
3c9acea31c
@ -37,10 +37,14 @@ app.include_router(tgos.router)
|
||||
app.include_router(waypoints.router)
|
||||
|
||||
|
||||
origins = []
|
||||
if ServerSettings.get().cors_allow_debug_server:
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:3000"],
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
origins.append("http://localhost:3000")
|
||||
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user