Repository navigation
v1.4.0
[1.4.0] - 2026-07-23
1.4.0 Breaking changes
HttpRequesthas been renamed intoHttpRequestViewto better reflect its non-owning semantics.HttpRequestis now a concrete owning type used in theHttpClientAPI to build a request, mirroringHttpResponse.- HTTP/2-specific
HttpRequestViewAPIs (isHttp2(),streamId(),scheme(),authority()) are now compiled only whenAERONET_ENABLE_HTTP2is on. Without HTTP/2, use the HTTP/1.x equivalents (e.g.headerValueOrEmpty("Host")forauthority()). - JSON/YAML body helpers now require
<aeronet/http-json.hpp>:HttpResponse::bodyJson/bodyYamlandHttpRequestView::bodyAs/bodyAsYamlkeep 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::logAPI now requires<aeronet/log.hpp>: the core headers no longer pull in spdlog transitively, so callers ofaeronet::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 (HMACHS*, RSARS*/PS*, ECDSAES*,EdDSA) over the OpenSSL already linked for TLS. Claim validation (exp/nbf/iss/aud/subwith configurable leeway + injectable clock), JWK/JWKS parsing withkidselection, and a security posture enforced by construction (alg:nonealways 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 (acmake_dependent_option, no new dependency). Also ships a url-safe, no-paddingbase64urlcodec inaeronet/tech. See FEATURES.md. - Automatic HTTP → HTTPS redirect: a plaintext listener can answer every request with a 3xx redirect to the equivalent
https://URL viaHttpServerConfig::withHttpsRedirect(targetHttpsPort = 443, statusCode = 301). The redirect host derives from the requestHostheader; the path and query are re-encoded soLocationis always a valid, injection-safe URL; a request with noHostgets400. Cannot be combined withtls.enabledon the same listener. - HTTP request rate-limiting middleware:
RateLimitRequestMiddlewareBuilderwith a configurable client-key strategy (peer address,X-Forwarded-For, custom header, or custom extractor). The default in-memory token-bucket backend returns429 Too Many RequestswithRetry-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//startupzfrom 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 beyondlivenessStaleThreshold(default10s), 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
HEADERSblock on a request stream (RFC 9113 §8.1) and surfaces its fields throughHttpRequestView::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 withRST_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_ERRORand hung; the window-exhausted remainder is now deferred and flushed asWINDOW_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 withMax 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:
requireClientCertcould be silently ignored whenrequestClientCert=false(reachable via config), so certificate-less clients were accepted; the invariantrequireClientCert ⇒ requestClientCertis now enforced on every configuration path. - Empty-body HTTP/1.1 responses omitted
Content-Length, defeating keep-alive reuse;Content-Length: 0is 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 withnull_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 toend()instead of dereferencing past the (shrunk) connection vector. - Fixed a Debug-only compilation error in
aeronet::fullVersionStringView()(<aeronet/version.hpp>). - Added
Content-typeheader 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
HttpResponsebecause reason should not be used, but may be interesting for very long URLs inHttpRequest. - 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-fileETag/Last-Modified/Content-Typefragments are formatted once and cached, validated on every request against file size + mtime (both read from thefstat()already performed on open, which also removes a redundant stat per request). Bounded LRU cache viaStaticFileConfig::headerCacheCapacity(default1024,0disables). - 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 ofstd::memcpy(~1.9x on isolated small copies, ~1.5x on a realistic HTTP fragment mix). HttpServerConfig::nbThreadsnarrowed tostd::uint16_t(wasstd::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
HttpResponsefrom 1024 to 65522. - Split the library into two CMake targets,
aeronet_serverandaeronet_client, plus a newaeronetumbrella interface library that pulls in both (existing<aeronet/aeronet.hpp>code is unaffected). - Added scripted HTTP/2 client benchmarks to CI (aeronet
HttpClientvs libcurl overh2candh2-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
StaticFileHandlerheader 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.