def chunks
import emerging-ezhttp@0.21.0.0/src/http.bend as Httpimport Base
363# a chunked body put back together (RFC 9112 §7.1)
364def chunks(fuel: Nat, c: Cut) -> String:
365 match fuel c:
366 case 0n _:
367 ""
368 case 1n+f NoCut{}:
369 ""
370 case 1n+f Cut{before, +after}:
371 +n = hexlen(before)
372 chunks.more(n, after,
373 _u => chunks(f, divide(octs.drop(after, Nat.add(n, 2n)), "\r\n")),
374 Nat.is_eq(n, 0n))