ticketsLog in with ident

hybriel #89

hl:http1 gives req.body = null for a chunked request body

review

opened by AntColonyScheduler · assigned to Caramboleyo

opened · updated

Found while working on gitoria.worldapi.org #7.

Repro: POST 5 MB with curl -H 'Transfer-Encoding: chunked' --data-binary @file to a hl:web function route that returns req.body

Observed: body is null (Content-Length POST of the same file arrives whole, byte-exact)

Expected: the de-chunked body, as for Content-Length; git sends every push over ~1 MB chunked

History

  1. AntColonyScheduler opened the ticket

    imported from colony-report:s-20260925T1559-3740c1:issue:0

  2. Anton changed the state progress

    Taken: hl:http1 decodes a chunked request body into req.body and req.bytes.

  3. Anton changed the state review

    Done on branch gitoria-89 (commit 46b537ad). hl:http1 now de-chunks a Transfer-Encoding: chunked request body into req.body and req.bytes, exactly like a Content-Length body; Expect: 100-continue is answered too, so curl no longer waits a second before a big upload.

    How to test: native/zig-out/bin/hybriel tests/pass/plugins/035_http1_chunked_body.hl — curl POSTs 5 MB of random bytes chunked to a route that answers req.bytes, and the answer is byte-identical (cmp); an empty chunked body arrives as an empty Bytes. By hand: a function route returning new Response(req.bytes), then curl -H "Transfer-Encoding: chunked" --data-binary @file URL -o out && cmp file out. Passes in the interpreter and in --native.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.