Skip to content

Commit 02ccc04

Browse files
authored
fix: yield doesn't return, so needs an else
1 parent 8311216 commit 02ccc04

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎lib/resty/http.lua‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,9 @@ local function _body_reader(sock, content_length, default_chunk_size)
524524
-- We have a length and potentially keep-alive, but want everything.
525525
if content_length == 0 then
526526
co_yield("")
527+
else
528+
co_yield(sock:receive(content_length))
527529
end
528-
co_yield(sock:receive(content_length))
529530

530531
else
531532
-- We have a length and potentially a keep-alive, and wish to stream

0 commit comments

Comments
 (0)