Skip to content

Commit

Permalink
Ignore preflight options in API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek authored and jmchilton committed Oct 13, 2024
1 parent 1eac67a commit d8190ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/base/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = "*"
Expand Down

0 comments on commit d8190ae

Please sign in to comment.