Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NZX/extra
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien committed Sep 30, 2024
2 parents 267d2c1 + f0b14d3 commit 54c3a10
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/py/extra/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,21 +434,19 @@ async def OnRequest(
if atom is HTTPProcessingStatus.Complete:
status = atom
elif isinstance(atom, HTTPResponse):
if atom.body:
yield atom.body
res = atom
if res.body:
yield res.body
break
else:
yield atom
iteration += 1
if (
# We continue if we have streaming
streaming is True
or res
and res.body
and HTTPBody.HasRemaining(res.body)
or res
and res.headers.contentType in {"text/event-stream"}
# We continue if we have streaming or
status is HTTPProcessingStatus.Processing
or streaming is True
or (res and res.body and HTTPBody.HasRemaining(res.body))
or (res and res.headers.contentType in {"text/event-stream"})
):
# TODO: We should swap out the body for a streaming body
cxn.isStreaming = True
Expand Down

0 comments on commit 54c3a10

Please sign in to comment.