Skip to content

Commit 8def3a7

Browse files
committed
Correct comment claiming that FastAPI answers HEAD requests automatically
It is only true for endpoints returning `FileResponse`, see fastapi/fastapi#1773 (comment).
1 parent bed78be commit 8def3a7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/galaxy/webapps/galaxy/api/job_files.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ class FastAPIJobFiles:
109109
for tool execution.
110110
"""
111111

112-
# FastAPI answers HEAD requests automatically for GET endpoints. However, because of the way legacy WSGI endpoints
113-
# are injected into the FastAPI app (using `app.mount("/", wsgi_handler)`), the built-in support for `HEAD` requests
114-
# breaks, because such requests are passed to the `wsgi_handler` sub-application. This means that the endpoint still
115-
# needs to include some code to handle this behavior, as tests existing before the migration to FastAPI expect HEAD
116-
# requests to work.
117-
#
112+
# FastAPI answers HEAD requests automatically for GET endpoints returning `FileResponse`. However, because of the
113+
# way legacy WSGI endpoints are injected into the FastAPI app (using `app.mount("/", wsgi_handler)`), the built-in
114+
# support for `HEAD` requests breaks, because such requests are passed to the `wsgi_handler` sub-application. This
115+
# means that the endpoint still needs to include some code to handle this behavior, as tests existing before the
116+
# migration to FastAPI expect HEAD requests to work.
118117
@router.get(
119118
# simplify me (remove `_args` and `_kwargs` defined using the walrus operator) when ALL endpoints have been
120119
# migrated to FastAPI, this is a workaround for FastAPI bug https://github.com/fastapi/fastapi/issues/13175

0 commit comments

Comments
 (0)