Skip to content

Commit 80f003e

Browse files
committed
fix: yield doesn't return, so needs an else
1 parent 9efaef8 commit 80f003e

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
@@ -540,8 +540,9 @@ local function _body_reader(sock, content_length, default_chunk_size)
540540
-- We have a length and potentially keep-alive, but want everything.
541541
if content_length == 0 then
542542
co_yield("")
543+
else
544+
co_yield(sock:receive(content_length))
543545
end
544-
co_yield(sock:receive(content_length))
545546

546547
else
547548
-- We have a length and potentially a keep-alive, and wish to stream

0 commit comments

Comments
 (0)