Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(body-reader): do not call sock:receive for reading 0 bytes #313

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions lib/resty/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ 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.
if content_length == 0 then
co_yield("")
end
co_yield(sock:receive(content_length))
Tieske marked this conversation as resolved.
Show resolved Hide resolved

Tieske marked this conversation as resolved.
Show resolved Hide resolved
else
Expand Down
Loading