Skip to content

Commit 2043d97

Browse files
committed
main.py: add CORSMiddleware for non-dev env
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
1 parent 6c4b5f4 commit 2043d97

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/teuthology_api/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def read_root(request: Request):
3434
allow_methods=["*"],
3535
allow_headers=["*"],
3636
)
37+
else:
38+
app.add_middleware(
39+
CORSMiddleware,
40+
allow_origins=[PULPITO_URL, PADDLES_URL],
41+
allow_credentials=True,
42+
allow_methods=["GET", "POST", "OPTIONS"],
43+
allow_headers=["Cookie"],
44+
)
3745

3846
app.add_middleware(SessionMiddleware, secret_key=SESSION_SECRET_KEY)
3947
app.include_router(suite.router)

0 commit comments

Comments
 (0)