Skip to content

v0.0.4

Choose a tag to compare

@Kludex Kludex released this 08 Jun 11:30
· 76 commits to main since this release
ba1b599

What's new

Send-side correctness

  • Auto-derive bodyless framing (#9). send_response no longer takes a bodyless argument - the connection derives it from the request method and status (HEAD, 1xx, 204, 304, CONNECT 2xx, RFC 9112 6.3), the way h11 does. The client side auto-frames bodyless responses too, so expect_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 LocalProtocolError with its own actionable message - all still catchable by the single LocalProtocolError / ProtocolError class.

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/upgrade are connection methods; expect_continue rides the Request event.

Docs

  • Accumulate parsed bodies into a bytearray in 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