Skip to content

Commit

Permalink
Merge pull request #14157 from mvdbeek/fix_streaming_response
Browse files Browse the repository at this point in the history
[22.01] Adapt byte content for StreamingResponse
  • Loading branch information
mvdbeek authored Jun 23, 2022
2 parents da4438a + 40c5605 commit 6c872e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/webapps/galaxy/api/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6c872e7

Please sign in to comment.