Skip to content

Commit 54c3a10

Browse files
committed
Merge branch 'main' of github.com:NZX/extra
2 parents 267d2c1 + f0b14d3 commit 54c3a10

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/py/extra/client.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,21 +434,19 @@ async def OnRequest(
434434
if atom is HTTPProcessingStatus.Complete:
435435
status = atom
436436
elif isinstance(atom, HTTPResponse):
437+
if atom.body:
438+
yield atom.body
437439
res = atom
438-
if res.body:
439-
yield res.body
440440
break
441441
else:
442442
yield atom
443443
iteration += 1
444444
if (
445-
# We continue if we have streaming
446-
streaming is True
447-
or res
448-
and res.body
449-
and HTTPBody.HasRemaining(res.body)
450-
or res
451-
and res.headers.contentType in {"text/event-stream"}
445+
# We continue if we have streaming or
446+
status is HTTPProcessingStatus.Processing
447+
or streaming is True
448+
or (res and res.body and HTTPBody.HasRemaining(res.body))
449+
or (res and res.headers.contentType in {"text/event-stream"})
452450
):
453451
# TODO: We should swap out the body for a streaming body
454452
cxn.isStreaming = True

0 commit comments

Comments
 (0)