Skip to content

Commit

Permalink
Merge pull request galaxyproject#18983 from jmchilton/fix_openapi_schema
Browse files Browse the repository at this point in the history
Ignore preflight options in API schema
  • Loading branch information
jmchilton authored Oct 13, 2024
2 parents 1eac67a + d8190ae commit fb70217
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 fb70217

Please sign in to comment.