diff --git a/lib/galaxy/webapps/galaxy/api/datasets.py b/lib/galaxy/webapps/galaxy/api/datasets.py index c78a12a0e0e6..cd4a8e6c88d6 100644 --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -2,7 +2,10 @@ API operations on the contents of a history dataset. """ import logging -from io import IOBase +from io import ( + BytesIO, + IOBase, +) from typing import ( Any, cast, @@ -259,6 +262,8 @@ def display( return FileResponse(file_name, headers=headers) elif isinstance(display_data, ZipstreamWrapper): return StreamingResponse(display_data.response(), headers=headers) + elif isinstance(display_data, bytes): + return StreamingResponse(BytesIO(display_data), headers=headers) return StreamingResponse(display_data, headers=headers) @router.get(