Skip to content

Commit 1e78667

Browse files
Updating logic to handle binaries similar to Sync request.
1 parent bdcf17b commit 1e78667

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jigsawstack/async_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def perform(self) -> Union[T, None]:
4646
# For binary responses
4747
if resp.status == 200:
4848
content_type = resp.headers.get("content-type", "")
49-
if content_type not in ["application/json", "text/html"]:
49+
if not resp.text or any(t in content_type for t in ["audio/", "image/", "application/octet-stream", "image/png"]):
5050
content = await resp.read()
5151
return cast(T, content)
5252

0 commit comments

Comments
 (0)