From d8190ae5542f7d7b807edea6a1b6b4a762ce588e Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 10 Oct 2024 17:14:53 +0200 Subject: [PATCH] Ignore preflight options in API schema --- lib/galaxy/webapps/base/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/base/api.py b/lib/galaxy/webapps/base/api.py index a0faf2b11371..2c8cc4b8b11c 100644 --- a/lib/galaxy/webapps/base/api.py +++ b/lib/galaxy/webapps/base/api.py @@ -264,7 +264,7 @@ def include_all_package_routers(app: FastAPI, package_name: str): # handle CORS preflight requests - synchronize with wsgi behavior. # this needs to happen last so it doesn't clobber routes with explicit cors handling # it doesn't affect the CORS middleware since the middleware terminates the request handling before routing - @app.options("/api/{rest_of_path:path}") + @app.options("/api/{rest_of_path:path}", include_in_schema=False) async def preflight_handler(request: Request, rest_of_path: str) -> Response: response = Response() response.headers["Access-Control-Allow-Headers"] = "*"