Skip to content

v1.4.0

Choose a tag to compare

@sjanel sjanel released this 23 Jul 07:58
· 1919 commits to main since this release
Immutable release. Only release title and notes can be modified.
21f7194

[1.4.0] - 2026-07-23

1.4.0 Breaking changes

  • HttpRequest has been renamed into HttpRequestView to better reflect its non-owning semantics. HttpRequest is now a concrete owning type used in the HttpClient API to build a request, mirroring HttpResponse.
  • HTTP/2-specific HttpRequestView APIs (isHttp2(), streamId(), scheme(), authority()) are now compiled only when AERONET_ENABLE_HTTP2 is on. Without HTTP/2, use the HTTP/1.x equivalents (e.g. headerValueOrEmpty("Host") for authority()).
  • JSON/YAML body helpers now require <aeronet/http-json.hpp>: HttpResponse::bodyJson/bodyYaml and HttpRequestView::bodyAs/bodyAsYaml keep their declarations in the core headers, but their definitions (and the Glaze include) moved to the new opt-in <aeronet/http-json.hpp> to keep Glaze's compile cost out of the core. Code using the <aeronet/aeronet.hpp> umbrella is unaffected.
  • The aeronet::log API now requires <aeronet/log.hpp>: the core headers no longer pull in spdlog transitively, so callers of aeronet::log::* must include it directly.

1.4.0 New features

HTTP client (HttpClient, AERONET_ENABLE_HTTP_CLIENT): a new synchronous HTTP client built on aeronet's own non-blocking transport + event-loop bricks, speaking both HTTP/1.1 and HTTP/2 natively (HTTP/2 reuses the server's HPACK + frame codecs, adding no dependency; the version is selected per client via HttpClientConfig::httpVersion - Auto / Http2 / Http1_1 - with ALPN negotiation over TLS and prior-knowledge h2c over cleartext). It provides HTTPS through the shared TlsTransport (peer/hostname verification, TLS version bounds, custom CA bundle, cipher list, mutual-TLS), per-origin keep-alive connection pooling, automatic redirect following with RFC 7231 method/body rewriting, a configurable retry policy with exponential backoff, transparent compression / decompression reusing the server codec bricks, outbound request trailers over both HTTP/1.1 (chunked framing) and HTTP/2 (a trailing HEADERS block), request bodies streamed directly from an open file (HttpRequest::file(...), with an optional offset/length sub-range) - zero-copy sendfile(2) over cleartext HTTP/1.1, read-and-encrypt over TLS, and bounded reads framed into DATA frames over HTTP/2 (tests: aeronet/client/test/http-client-core_test.cpp *FileBody*, http-client-http2-e2e_test.cpp *FileBody*, http-client-tls-e2e_test.cpp PostFileBodyOverTls*, aeronet/sys/test/transport_test.cpp *SendFile*), cleartext forward-proxy support (withProxy, opening an HTTP CONNECT tunnel for https origins), and an opt-in time-based response cache for idempotent requests (withCache). Every request returns an HttpClientResult (std::expected<HttpResponse, HttpClientErrc>), so per-request runtime failures are values rather than exceptions; a single HttpClient is not thread-safe (use one per thread). See HTTP client.

  • JWT (JWS profile) module (aeronet_jwt, AERONET_ENABLE_JWT): sign and verify JSON Web Tokens (RFC 7519) across the full JWS algorithm suite (HMAC HS*, RSA RS*/PS*, ECDSA ES*, EdDSA) over the OpenSSL already linked for TLS. Claim validation (exp/nbf/iss/aud/sub with configurable leeway + injectable clock), JWK/JWKS parsing with kid selection, and a security posture enforced by construction (alg:none always rejected, algorithm-family anti-confusion, signature verified before any claim, constant-time HMAC). Exception-free, JWE out of scope, and enabled by default whenever OpenSSL + Glaze are present (a cmake_dependent_option, no new dependency). Also ships a url-safe, no-padding base64url codec in aeronet/tech. See FEATURES.md.
  • Automatic HTTP → HTTPS redirect: a plaintext listener can answer every request with a 3xx redirect to the equivalent https:// URL via HttpServerConfig::withHttpsRedirect(targetHttpsPort = 443, statusCode = 301). The redirect host derives from the request Host header; the path and query are re-encoded so Location is always a valid, injection-safe URL; a request with no Host gets 400. Cannot be combined with tls.enabled on the same listener.
  • HTTP request rate-limiting middleware: RateLimitRequestMiddlewareBuilder with a configurable client-key strategy (peer address, X-Forwarded-For, custom header, or custom extractor). The default in-memory token-bucket backend returns 429 Too Many Requests with Retry-After, and installs globally (Router::addRequestMiddleware) or per-route / per-RouteGroup. Ships an optional Redis sliding-window contract (RedisSlidingWindowRateLimitStore, exposing the Lua script payload and a deterministic key schema) for distributed multi-instance synchronization.
  • Dedicated probe listener for MultiHttpServer: BuiltinProbesConfig::withDedicatedPort(port) serves /livez / /readyz / /startupz from a separate single-threaded event loop, isolating probe availability from worker load. Liveness is heartbeat-based - each worker publishes a heartbeat at the top of every loop iteration, and the pod is reported unhealthy only when every worker's heartbeat has been stale beyond livenessStaleThreshold (default 10s), so a busy-but-progressing worker stays live while a full deadlock trips it. Opt-in (dedicatedPort == 0, the default, keeps probes inline). See the Kubernetes deployment guide.
  • Client address on the request: HttpRequestView::clientAddress(), populated from the peer socket address for both HTTP/1.1 and HTTP/2.
  • HTTP/2 request trailers: the server now accepts a trailing HEADERS block on a request stream (RFC 9113 §8.1) and surfaces its fields through HttpRequestView::trailers() / trailerValueOrEmpty(), exactly like HTTP/1.1 chunked trailers. Pseudo-header fields in trailers and a trailing block that does not end the stream are rejected with RST_STREAM(PROTOCOL_ERROR); trailer bytes count toward the request header-size budget. Tests: aeronet/http2/test/http2-protocol-handler_test.cpp (RequestTrailers*), aeronet/client/test/http-client-http2-e2e_test.cpp (*RequestTrailer*, LargeBodyThenTrailers, ReusableAfterTraileredRequest).

1.4.0 Bug fixes

  • Request trailers could leak across keep-alive requests: after a chunked request carrying trailers, the per-connection trailer length was not reset for a subsequent fixed-length request on the same connection, so the server spuriously re-parsed the previous request's trailer bytes into HttpRequestView::trailers(). The trailer length is now cleared for non-chunked bodies.
  • HTTP/2 responses larger than the peer's flow-control window could never be delivered - a buffered response body exceeding the stream/connection send window (e.g. > ~64 KiB against the RFC 9113 default window) failed with FLOW_CONTROL_ERROR and hung; the window-exhausted remainder is now deferred and flushed as WINDOW_UPDATEs arrive, trailers included.
  • HTTP/2 server leaked active-stream accounting for responses completed outside frame processing (flow-control-deferred bodies, file payloads flushed from onOutputWritten, async completions), so a long-lived connection eventually died with Max concurrent streams exceeded.
  • HTTP/2 responses could carry field values with trailing whitespace, which strict peers (nghttp2, hence curl) reject per RFC 9113 §8.2.1 - so every compressed response over HTTP/2 failed for such clients. Header values are now OWS-trimmed before HPACK encoding.
  • Large TLS responses could be truncated by ~one 16 KiB record under load - a fatal error left on the shared per-thread OpenSSL error queue by read / handshake was misclassified against the next connection's benign would-block write, dropping a still-pending TLS record. Both paths now drain the queue on every fatal return.
  • mTLS: requireClientCert could be silently ignored when requestClientCert=false (reachable via config), so certificate-less clients were accepted; the invariant requireClientCert ⇒ requestClientCert is now enforced on every configuration path.
  • Empty-body HTTP/1.1 responses omitted Content-Length, defeating keep-alive reuse; Content-Length: 0 is now synthesized (excluding statuses that must not carry it, HEAD, and file / streaming / direct-compression responses).
  • Response status-line omitted the mandatory SP before an empty reason-phrase (HTTP/1.1 200\r\n), which strict RFC 9112 parsers may reject; aeronet now always emits the separator (HTTP/1.1 200 \r\n).
  • glaze JSON/YAML reads could over-read a non-null-terminated body buffer - HttpRequestView::bodyAs<T>() / bodyAsYaml<T>() now parse with null_terminated = false.
  • Out-of-bounds read on a stale poll event (rare macOS-only crash) - ConnectionStorage::iterator(fd) now maps any out-of-range fd to end() instead of dereferencing past the (shrunk) connection vector.
  • Fixed a Debug-only compilation error in aeronet::fullVersionStringView() (<aeronet/version.hpp>).
  • Added Content-type header for built-in server error messages with a body.

1.4.0 Improvements

  • Raised status line max size from 64KiB to 16MiB - this is not so useful for HttpResponse because reason should not be used, but may be interesting for very long URLs in HttpRequest.
  • Lower compile-time footprint of the core HTTP headers: the two compile-time heaviest dependencies - Glaze and spdlog - no longer leak into the widely-included headers, so most translation units stop paying for them even when they never serialize JSON or log (see the header breaking changes above).
  • Pre-computed static-file response headers (StaticFileHandler): the per-file ETag / Last-Modified / Content-Type fragments are formatted once and cached, validated on every request against file size + mtime (both read from the fstat() already performed on open, which also removes a redundant stat per request). Bounded LRU cache via StaticFileConfig::headerCacheCapacity (default 1024, 0 disables).
  • Faster CaseInsensitiveEqual - header-name matching, one of the hottest server operations, now compares 16 bytes at a time (SSE2 on x86-64, NEON on ARM): ~35–57% faster than the previous 8-byte SWAR on strings ≥ 16 bytes.
  • Faster small Copy / Append (memory-utils.hpp): runtime-sized copies of ≤ 32 bytes use a couple of inline overlapping stores instead of std::memcpy (~1.9x on isolated small copies, ~1.5x on a realistic HTTP fragment mix).
  • HttpServerConfig::nbThreads narrowed to std::uint16_t (was std::uint32_t): one thread maps to one event loop, so the 16-bit range documents the valid bound. JSON/YAML values above 65535 are now rejected; source-compatible for normal use.
  • Increased the maximum length of reason in HttpResponse from 1024 to 65522.
  • Split the library into two CMake targets, aeronet_server and aeronet_client, plus a new aeronet umbrella interface library that pulls in both (existing <aeronet/aeronet.hpp> code is unaffected).
  • Added scripted HTTP/2 client benchmarks to CI (aeronet HttpClient vs libcurl over h2c and h2-TLS), published per protocol to GitHub Pages with matching badges.
  • Better memory reservation for HPACK headers in HTTP/2 instead of a fixed 512-byte reserve.
  • Improved StaticFileHandler header metadata cache by changing the O(n) search for cache eviction into a O(1) LRU linked-list with a hash map for fast lookup.