lua-resty-http
lua-resty-http copied to clipboard
get_client_body_reader should add support for chunked request body
Hi @pintsized
get_client_body_reader
return nil for a chunked request body. it's because ngx.req.socket
is not yet support chunked request body.
however,i think lua-resty-http should fix the case with ngx.req.read_body
.
thanks.
I wonder if this issue should be closed. I can see support for chunked request body (although I have not tried myself)
From https://github.com/ledgetech/lua-resty-http/blob/master/lib/resty/http.lua#L991-L1000
local headers = ngx_req_get_headers()
local length = headers.content_length
if length then
return _body_reader(sock, tonumber(length), chunksize)
elseif transfer_encoding_is_chunked(headers) then
-- Not yet supported by ngx_lua but should just work...
return _chunked_body_reader(sock, chunksize)
else
return nil
end