Skip to content

Commit

Permalink
fix: yield doesn't return, so needs an else
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored May 21, 2024
1 parent 8311216 commit 02ccc04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/resty/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,9 @@ local function _body_reader(sock, content_length, default_chunk_size)
-- We have a length and potentially keep-alive, but want everything.
if content_length == 0 then
co_yield("")
else
co_yield(sock:receive(content_length))
end
co_yield(sock:receive(content_length))

else
-- We have a length and potentially a keep-alive, and wish to stream
Expand Down

0 comments on commit 02ccc04

Please sign in to comment.