Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/resty/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,11 @@ local function _body_reader(sock, content_length, default_chunk_size)

elseif not max_chunk_size then
-- We have a length and potentially keep-alive, but want everything.
co_yield(sock:receive(content_length))
if content_length == 0 then
co_yield("")
else
co_yield(sock:receive(content_length))
end

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