Skip to content

Commit b788aa4

Browse files
committed
[DNM] main.py: allow CORS methods and headers
allow_methods: POST and OPTIONS (GET was allowed by default) allow_headers: "*" Signed-off-by: Vallari Agrawal <[email protected]>
1 parent 6c4b5f4 commit b788aa4

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=["*"],
44+
)
3745

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

0 commit comments

Comments
 (0)