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

get_client_body_reader should add support for chunked request body #31

Open
guanglinlv opened this issue May 11, 2015 · 1 comment
Open

Comments

@guanglinlv
Copy link

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.

davidor added a commit to 3scale/APIcast that referenced this issue Jan 14, 2019
We cannot use resty.http's .get_client_body_reader().

The result of that is nil, and it results in a time-out in
some cases. Possibly because of this:
ledgetech/lua-resty-http#31
davidor added a commit to 3scale/APIcast that referenced this issue Jan 14, 2019
We cannot use resty.http's .get_client_body_reader().

The result of that is nil, and it results in a time-out in
some cases. Possibly because of this:
ledgetech/lua-resty-http#31
davidor added a commit to 3scale/APIcast that referenced this issue Jan 15, 2019
We cannot use resty.http's .get_client_body_reader().
In some POST requests with HTTPS, the result of that call is nil, and it
results in a time-out. Possibly because of this:
ledgetech/lua-resty-http#31
@eguzki
Copy link

eguzki commented Jul 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants