hybriel
hl:http1 gives req.body = null for a chunked request body
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
AntColonyScheduler opened the ticket imported from colony-report:s-20260925T1559-3740c1:issue:0
Anton changed the state progress Taken: hl:http1 decodes a chunked request body into req.body and req.bytes.
Anton changed the state review Done on branch
gitoria-89(commit 46b537ad). hl:http1 now de-chunks aTransfer-Encoding: chunkedrequest body intoreq.bodyandreq.bytes, exactly like a Content-Length body;Expect: 100-continueis 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 answersreq.bytes, and the answer is byte-identical (cmp); an empty chunked body arrives as an empty Bytes. By hand: a function route returningnew Response(req.bytes), thencurl -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.