changelog
0.4.1
- fix: idle pooled connections the peer has closed are destroyed before the next request, whichever origin it goes to. They used to stay in CLOSE_WAIT until a request to their own origin picked them up, so a client talking to origins that reap idle connections (the Bluesky AppView does) held dozens of dead sockets.
0.4.0
- breaking:
extra_headershas no count limit, anderror.TooManyHeadersis gone. Before,acceptplusextra_headershad to fit in eight slots, so a proxy forwarding a client's headers failed before sending anything. Outgoing headers are now bounded only by what the caller passes, as in undici and hyper; the merged list is allocated only whenacceptandextra_headersare both set, and redirect scoping copies it only on a cross-origin hop.
0.3.0
- breaking: zttp no longer links libc, so consumers that relied on it
for their own C calls must set
link_libcthemselves. zttp and its examples build forx86_64-linux-noneas static binaries. - breaking: head and total deadlines are absolute across redirects and
retries, and every configured guard needs
Io.concurrent. A request with a deadline on anIothat cannot run concurrent tasks fails witherror.ConcurrencyUnavailableinstead of being sent without its deadline. Cancellation joins the operation before returning. - feat:
Client.shutdown(timeout_ns)stops new requests (ClientClosed), waits for owned requests and responses, and closes idle TLS connections withclose_notifywithin one budget.deinitattempts it withshutdown_deadline_ns. - fix: a body cut short of its Content-Length fails with
ResponseTruncatedinstead of returning a short body with a 200. - fix: response framing is validated before a connection is reused.
- security: a redirect to another origin drops
Authorization,CookieandProxy-Authorizationfrom the caller's extra headers, as it already did for the request's own authorization. - tests:
just conformanceruns an isolated real-socket HTTP gate; seetests/conformance/README.md.
0.2.0
First stable release of the Zig 0.17 line. Everything since 0.2.0-alpha.5 is tooling and docs; the client is unchanged.
- docs:
scripts/MACOS_TRUST.mddescribes an optional, reversible patch that applies the same compromised-key exclusions to Zig 0.17.0's own macOS keychain loader, sozig fetchgets the protection too. It defaults to a dry run and requires an exact source checksum. - tools:
scripts/std_http_trust_probe.zigmakes the directstd.httptrust check reproducible. - docs:
AGENTS.mdnames the checks to run;just checkandjust fmtcoverscriptsandexamples.
0.2.0-alpha.5
- feat:
zttp.distrustCompromisedKeys(bundle)exposes the CA distrust pass for callers that build their ownstd.httpclient and bundle.
0.2.0-alpha.4
- fix: remove the four roots and eight compromised intermediate public keys
from the October 2026 eMudhra incident from every loaded CA bundle, including
caller-supplied bundles. Keys are blocked by SubjectPublicKeyInfo digest, so
cross-signing cannot restore them. Chains anchored only at those roots fail.
The original certificates are kept as offline fixtures under
src/trust-fixtures/;zig build trust-probechecks the public bad-chain hosts and a control through the real client.
0.2.0-alpha.3
- fix: refresh TLS certificate validation time before each HTTPS connection, including redirects and explicitly resolved addresses. Long-lived clients could reject newly rotated certificates using the time of their first request.
- fix: initialize trust before the first explicitly resolved TLS connection.
- TLS connection setup is serialized per client to protect std.http's shared validation timestamp; response heads and bodies still progress concurrently.
- A real local TLS regression covers stale timestamps, hostname rejection, and overlapping requests on a shared client.
0.2.0-alpha.2
- built and tested against the zig 0.17.0 release;
minimum_zig_versionis now0.17.0. - fix:
Response.streamdelivers body bytes that are already buffered before it reads the network again. a server that sends one event and then waits for the client (SSE, request/response over one body) stalled until its own timeout. - fix: a canceled
fetchoropenreturnserror.Canceledwhile waiting for the response head. the head watcher swallowed the cancel and then waited on the head with no bound, so a cancel against a silent peer never returned. - fix: the head deadline, request deadline and stall guard now hold when
the
Iorunsasyncwork inline, whichIo.Threadeddoes once it is at its async limit (always on a 1-vCPU machine). the watchers start their work withio.concurrent; if theIoanswersConcurrencyUnavailablethe request runs without guards and logs one warning per process. - fix: a pooled keep-alive connection that the peer resets instead of
answering is replayed for idempotent requests. std reports the reset as
error.ReadFailed, which was surfaced to the caller; a clean close was already replayed. head read failures now carry the socket's own error (error.ConnectionResetByPeerand friends) instead oferror.ReadFailed.
0.2.0-alpha.1
- breaking: requires zig 0.17. Built and tested against
0.17.0-dev.2384+ac77c23af; 0.16 users stay on 0.1.x. - port to 0.17:
Uri.getHost->Io.net.HostName.fromUri,a ** b->@splat,ascii.indexOfIgnoreCase->findIgnoreCase,b.args->addPassthruArgs.
0.1.2
- preserve signed
RateLimit-Resetvalues for protocol-specific retry policies.RateLimitHeaders.resetis now?i64; explicitly typed unsigned callers must update. Generic delay selection retains Retry-After priority and treats negative reset values as expired.
0.1.1
- fix: accept RFC 850 and asctime HTTP dates in
Retry-After, alongside IMF-fixdate. Reject impossible calendar dates and out-of-range times.
0.1.0
- initial release:
zttp.Clientwith a response-head deadline, a body stall guard (idle and minimum-rate), dead-connection replay for idempotent requests, redirect handling that never replays a body, transparent gzip, rate-limit header parsing, caller-selected response header capture, a checked-address dial path, and a real defaultUser-Agent. - feat:
FetchOptions.accept_encodingreplaces std's defaultgzip, deflatefor one request. anaccept-encodinginextra_headerswould have been sent alongside std's, as a second header. - feat:
Client.openreturns aResponseonce the head is in;Response.streamdrains the body into anystd.Io.Writerunder the stall guard, an optional byte cap, progress counters, and what the request deadline has left.fetchis nowopenplus a stream into memory, so both paths share every guard. for bodies that belong on disk, or sinks that depend on the status. - fix:
authorizationno longer follows a redirect to another origin. zig 0.16'sstd.http.Clientstripsprivileged_headerson a domain change but never writes them to the wire, so the only way to protect the token was forfetchto run the redirect loop itself. it now does, with loop detection, a hop limit (Client.redirects.max_hops), no https to http downgrade by default, RFC-shaped method rewrites (303 and 301/302-on-POST become a bodiless GET, 307/308 resend the body), andauthorizationdropped whenever a hop changes scheme, host, or port. - change:
FetchOptions.redirect_behavior(a std type) is replaced byon_redirect: .follow | .surface | .refuse. aresolved_connectionrequest is never redirected away from the vetted address; its 3xx is surfaced. - change: a payload without
content_typeiserror.MissingContentTypeinstead of a silent request with no content-type header. - feat:
zttp.Errornames every failure the client adds over std's. - fix:
StallGuard.min_bytes_per_sis measured over a trailingwindow_ns(default 10s) instead of a lifetime average. a body that arrived at megabytes per second and then trickles was never caught: the average stayed high for as long as the burst was large. - fix: the guard watchers poll every 10ms instead of sleeping a full 100ms (body) or 50ms (head) before their first check. every fetch paid up to 100ms of floor even when the body landed at once.
- feat:
FetchOptions.deadline_nsbounds the whole request;head_deadline_nsandstallcan be overridden per request, andClient.max_response_sizesets a default cap. callers no longer mutate shared client fields to get a per-call budget. - fix:
max_response_sizeis enforced while the body streams. it used to allocate the whole cap up front and then copy the body out of it. - fix: a URL containing a control character, or a header containing CR/LF, is refused
(
error.InvalidUrl,error.InvalidHeader). std writes the request line verbatim and only asserts on headers, so outside input could inject headers or crash a safe build. - feat:
Retry-Afterin http-date form is parsed (retry_after_at), andRateLimitHeaders.delaySeconds(now)ranksRetry-AfteroverRateLimit-Resetand reads a reset at or past 1e9 as an absolute time. - feat:
FetchResult.final_urlreports where a followed redirect ended up.