lua-resty-http icon indicating copy to clipboard operation
lua-resty-http copied to clipboard

get_client_body_reader should add support for chunked request body

Open guanglinlv opened this issue 9 years ago • 1 comments

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.

guanglinlv avatar May 11 '15 10:05 guanglinlv

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

eguzki avatar Jul 05 '23 14:07 eguzki