File tree 1 file changed +7
-9
lines changed 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -434,21 +434,19 @@ async def OnRequest(
434
434
if atom is HTTPProcessingStatus .Complete :
435
435
status = atom
436
436
elif isinstance (atom , HTTPResponse ):
437
+ if atom .body :
438
+ yield atom .body
437
439
res = atom
438
- if res .body :
439
- yield res .body
440
440
break
441
441
else :
442
442
yield atom
443
443
iteration += 1
444
444
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" })
452
450
):
453
451
# TODO: We should swap out the body for a streaming body
454
452
cxn .isStreaming = True
You can’t perform that action at this time.
0 commit comments