v0.0.4
What's new
Send-side correctness
- Auto-derive bodyless framing (#9).
send_responseno longer takes abodylessargument - the connection derives it from the request method and status (HEAD,1xx,204,304,CONNECT2xx, RFC 9112 6.3), the way h11 does. The client side auto-frames bodyless responses too, soexpect_bodyless()is gone. - Content-Length is enforced (#11). Sending more body than declared, or ending a message with bytes still owed, now raises instead of serializing a malformed message. Trailers on a non-chunked message are rejected too. Matches h11's
ContentLengthWriter. - Specific error messages (#12). Each send-side misuse (over-send, under-send, trailers, wrong order) raises
LocalProtocolErrorwith its own actionable message - all still catchable by the singleLocalProtocolError/ProtocolErrorclass.
Connection signals for server loops
conn.should_close(),conn.upgrade(),request.expect_continue(#10). Keep-alive, protocol-upgrade, and 100-continue decisions are derived in Zig from the parsed request, so a server (e.g. uvicorn's zttp backend) no longer re-scans headers in Python.should_close/upgradeare connection methods;expect_continuerides theRequestevent.
Docs
- Accumulate parsed bodies into a
bytearrayin the examples (#8), Installation requirements (#7), logo (#6).
All changes are additive or internal; the read path is unchanged in performance.
Full changelog: v0.0.3...v0.0.4