Skip to content

read chunked responses ... doesn't seem to work in chunks #38

@jonathon-love

Description

@jonathon-love

hi,

i'm reading chunked responses from a requests.post(...), however calling local chunk, err = r:iter_content() doesn't give me a chunk each time, but rather many of the chunks all joined together. i.e. the following outputs a single big chunk.

local chunk, err = r:iter_content()

ngx.log(ngx.ERR, "CHUNK")
ngx.log(ngx.ERR, chunk)
ngx.log(ngx.ERR, "END CHUNK")

if i access the same endpoint with, say, a js XHR i successfully get each of the chunks coming through separately.

if i set a very small chunk size in the r:iter_content() call, i can get an approximation of the desired behaviour (indicating that it is receiving the chunks from the server in a chunk like fashion ... and i can also confirm that the chunked encoding heading is being successfully read in the r.headers.

i am using the 7.3-1 from luarocks.

any tips on how i could debug this?

with thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions