From c890d5f1c5d7ff10c8f80663b70aeed22c0397bc Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 15 Jun 2025 13:42:18 +0000 Subject: [PATCH] API: Add the CORS middleware Signed-off-by: Michael Tremer --- src/api/app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/app.py b/src/api/app.py index ad273304..3546ae99 100644 --- a/src/api/app.py +++ b/src/api/app.py @@ -19,6 +19,7 @@ ############################################################################### import fastapi +import fastapi.middleware.cors app = fastapi.FastAPI( title = "Pakfire Build Service API", @@ -27,3 +28,12 @@ app = fastapi.FastAPI( # Enable debug mode debug = True, ) + +# Add CORS +app.add_middleware( + fastapi.middleware.cors.CORSMiddleware, + allow_origins=["https://pakfire.ipfire.org"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) -- 2.47.2